Probably want to look into using forms alittle more... here is how it is done:
http://www.devguru.com/technologies/html/6262.asp
Although the language is client side, the call should be made to check for error just before it is submitted!
: iam trying a self submitting form,, everything is working.. i just
: need to write on the document what the error is.. e.g, if login is
: incorrect, it should write "incorrect" after the text box in red..
: this is just a test page..
: <%@ Language="VBSCRIPT" %>
: <html>
: <head>
: <title>Sample</title>
:
: <style type="text/css">
: <!--
: .style1 {font-family: Geneva, Arial, Helvetica, sans-serif}
: -->
: </style>
:
: <script language="vbscript" runat="server">
This actually in the page?? if so are you going to name the Subroutine?
: dim err
: err=false
:
: If ucase(trim(request.ServerVariables("REQUEST_METHOD")))="POST" Then
: if ( Request.form("login") = "asfia") then
: Response.Redirect("hello.asp")
: else
: err = true
: Response.Write(err)
: End if
: End if
: </script>
: </head>
: <body >
: <h1 align="center" class="style1" > APT System
: </h1>
: <form name="form1" method="post" action="<%Response.Write
: request.ServerVariables("SCRIPT_NAME")%>">
Here is where you will check the input with some call using the =onsubmit method
: <table width="257" align="center" cellpadding="2" cellspacing="10"
: >
: <tr valign="middle">
: <td>Login </td>
: <td><input type="text" name="login" tabindex="1" id = "login"
: value="<%Response.Write(Request.Form("login"))%>">
: </td>
: <!--<td><p style="color:red ">response.Write("err")<%if err =
: true then Response.Write("Incorrect login") end if %></p> </td>
: </tr>-->
: <tr>
: <td>Password </td>
: <td><input type="password" name="pass" tabindex="2" id="pass">
: </td>
: </tr>
: <tr>
: <td><input type="submit" name="Submit" value="Submit"
: tabindex="3" id="enter"></td>
: </tr>
: </table>
: </form>
: hello
: <%Response.Write(err)%> THE PAGE DOESNT DISPLAY ERR STATE HERE..WHY?
Not of text datatype
: </body>
: </html>
:
: