Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

error checkin usin javascript

Options
  • 31-07-2007 9:31am
    #1
    Registered Users Posts: 36


    this my store.asp, it still is not displaying the error message when the text field is submitted empty, any ideas, thanks

    <%@LANGUAGE=&quot;VBSCRIPT"%>
    <script language="javascript" type="text/javascript" >
    function test(objName)
    {
    var checkStr = objName;
    if( checkStr.value.length > 0 )
    {
    alertsay = "Please enter values greater than zero"
    alert(alertsay);
    }
    }
    </script>

    <html>
    <body>
    <form action="store.asp" method="post" onSubmit="test(this);">
    Your name: <input type="text" name="fname" size="20" />
    <input type="submit" value="Submit" />
    </form>
    <%
    dim fname
    fname=Request.Form("fname")
    If fname<>"" Then
    Response.Write("Hello " & fname & "!<br />")
    Response.Write("How are you today?")
    End If
    %>
    </body>
    </html>


Comments

  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    Duplicate thread - have a look at the replies in your other version here


Advertisement