Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Form Validation Javascript Help

    G'day ppl,

    I have just found a form validation script and all is working fine
    the only thng is that in my form i have a drop menu and i cant figure out how to get this to work.

    the script so far is.

    Code:
    <script language="JavaScript">    function formCheck() 
        {
           if (document.JFCSMS.SURNAME.value == "") 
    {
    alert("Please enter SURNAME.");
    document.JFCSMS.SURNAME.focus();
    return false;
    }
           if (document.JFCSMS.NAME.value == "") 
    {
    alert("Please enter NAME.");
    document.JFCSMS.NAME.focus();
    return false;
    }
    
           if( isNaN(document.JFCSMS.MOBILE NUMBER.value) )
    {
    alert('Please enter a vaild Mobile Number!');
    document.JFCSMS.MOBILE NUMBER.focus();
    return false;
    }
           if (document.JFCSMS.MOBILE NUMBER.value == "") 
    {
    alert("Please enter Mobile Number.");
    document.JFCSMS.MOBILE NUMBER.focus();
    return false;
    } 
    
        }
    
    
    </script>
    </head>
    <body>
                    <form name="JFCSMS" method="post" action="cgi-bin/FormMail.pl" onsubmit="return formCheck()">
    <input type=hidden name="recipient" value="email@myserver.com.au">
    <p><span style="font-size:9pt;"><font face="Arial"><input type="text" name="SURNAME"><br>
    </font><font face="Arial" color="black">Given Name:<input type="text" name="NAME"><br>
    Mobile Number:</font><font face="Arial"><input type="text" name="MOBILE NUMBER"><br>
    </font><font face="Arial" color="black">Relation to JFC:</font></span><br>
    <select name="RELATION TO JFC" size="1">
                            <option selected value>- - - - - - - - -</option>
                            <option>Coach</option>
                            <option>Committee</option>
                            <option>Parent</option>
                            <option>Past Player</option>
                            <option>Player</option>
                            <option>Sponsor</option>
                            <option>Volunteer</option>
                            <option>Other</option>
    </select><br><input type=hidden name="title" value="JFC SMS Registration">
    <br><input type=hidden name="redirect" value="http://www.myserver.com.au/thanks.html">
    <input type="submit" name="SUBMIT" value="Submit"> <input type="reset" name="RESET" value="Clear"></form>
    </body>
    If anyone can help me that would be great Thanks

    Bryce

  • #2
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Fixed

    DW i fixed the problem


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •