Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VarType and passing values in forms

Status
Not open for further replies.

bgreenhouse

Technical User
Feb 20, 2000
231
CA
Hi again...

I'm having a strange problem...I am writing a login/pw validate script. I have written one before, and it worked fine. All of a sudden though, I'm having problems with data type mismatches. I have checked everything, tried using cStr functions etc...nothing works. So I just wanted to see what type of variable was coming in from my imput form. I wrote the following .asp:

<%@ LANGUAGE=&quot;VBSCRIPT&quot; %>
<% Dim Prefix, Crdnum, strPIN
Prefix = &quot;12345678901&quot;
Crdnum = Request.form(&quot;Cardnum&quot;)
Crdnum = Prefix&amp;Crdnum
strPIN = Request.form(&quot;PIN&quot;)
%>
<html>
<head>

</head>
<body>
Hi <%=CrdNum%>! Your PIN is <%=strPIN%>
<SCRIPT LANGUAGE = &quot;vbscript&quot;>
<!--
Alert &quot;CrdNum is a type &quot; &amp; VarType(CrdNum) &amp; &quot; Variant and strPIN is a type &quot; &amp; VarType(strPIN) &amp; &quot;Variant.&quot;
-->
</SCRIPT>
</body>
</html>

It displays the variables when prompted to do so in the HTML document, but when it alerts me of the VarType, both are &quot;0&quot;, meaning empty. But it just put the variables on the web page, so obviously they're not empty! Any ideas as to what's going on?

Ben
 
Try this instead...
Code:
<SCRIPT LANGUAGE = &quot;vbscript&quot;>
     <!--
    Alert &quot;CrdNum is a type &quot; &amp; <%=VarType(CrdNum)%> &amp; &quot; Variant and strPIN is a type &quot; &amp; <%=VarType(strPIN)%> &amp; &quot;Variant.&quot;
     -->
     </SCRIPT>

Hope it helps, Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top