hoachen
03-23-2006, 10:57 AM
I am pretty new to ASP and I got this type mismatch problem when I press the submit button. I set the textbox of user to type in the number from 0 to 100. When the user press the submit button this two textboxes infor will email to my email account. I am using asp to do that. Please my asp code below.
Here is the HTML
<tr>
<td colspan="6" class="whiteText">PED
<input type="text" size="10" name="myInput" onKeyUp="writeMessage()" id="myInput" />% and Adult:
<input type="text" size="10" name ="mySecondInput" onKeyUp="writeMessage()"/>%</td>
</tr>
ASP. (I COULDN'T USE REQUESTION.FORM FOR MY SECOND INPUT BECAUSE IT AUTOMATICALLY FILLED IN WHEN THE FIRST BOX THE VALUE IS TYPE SO I AM USING DECLARE A VARIABLE AND THE USING 100 TO MINUS WHAT THE USER INPUT TO GET MY SECOND VALUE. CAN YOU SPOT THE ERROR? PLEASE HELP
dim adult
adult = 100 - REQUEST.FORM("myInput")
IF REQUEST.FORM("myInput") <> "" THEN
message = message & "<br> <b> Patient Mix: PED: </b>" & REQUEST.FORM("myInput2") & "%" & "<b>Adult: </b>" & adult & " % "
ELSE
message = message & "<br> <b> Patient Mix: PED: </b> N/A " & " " & " <b> Adult: </b> N/A "
END IF
Here is the HTML
<tr>
<td colspan="6" class="whiteText">PED
<input type="text" size="10" name="myInput" onKeyUp="writeMessage()" id="myInput" />% and Adult:
<input type="text" size="10" name ="mySecondInput" onKeyUp="writeMessage()"/>%</td>
</tr>
ASP. (I COULDN'T USE REQUESTION.FORM FOR MY SECOND INPUT BECAUSE IT AUTOMATICALLY FILLED IN WHEN THE FIRST BOX THE VALUE IS TYPE SO I AM USING DECLARE A VARIABLE AND THE USING 100 TO MINUS WHAT THE USER INPUT TO GET MY SECOND VALUE. CAN YOU SPOT THE ERROR? PLEASE HELP
dim adult
adult = 100 - REQUEST.FORM("myInput")
IF REQUEST.FORM("myInput") <> "" THEN
message = message & "<br> <b> Patient Mix: PED: </b>" & REQUEST.FORM("myInput2") & "%" & "<b>Adult: </b>" & adult & " % "
ELSE
message = message & "<br> <b> Patient Mix: PED: </b> N/A " & " " & " <b> Adult: </b> N/A "
END IF
