Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

error checkin usin javascript

  • 31-07-2007 08:31AM
    #1
    Registered Users, Registered Users 2 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,152 ✭✭✭✭Liam Byrne


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


Advertisement
Advertisement