The flollowing code is a question asked me for an interview.....Anyone can help me how to validate this form professionaly.....using javascript. please help me........
1. Consider the following fragment of HTML. <SCRIPT LANGUAGE=javascript> <!-- function checkRequired() { ... } //--> </SCRIPT> ... <form name=RegForm method=post onsubmit="checkRequired()"> <table> <tr><td>*Title:</td> <td><select name=Title> <option selected>Mr</option> <option>Mrs</option> <option>Ms</option> <option>Miss</option> </select></td></tr> <tr><td>First name:</td> <td><input type=text name=FirstName size=20 maxlength=20 value=''></td></tr> <tr><td>Last name:</td> <td><input type=text name=LastName size=20 maxlength=20 value=''></td></tr> <tr><td>Date of birth:</td> <td><input type=text name=DOB size=20 maxlength=20 value=''> <tr><td>Address:</td> <td><input type=text name=Address size=30 maxlength=128 value=''></td></tr> <tr><td>Town:</td> <td><input type=text name=Town size=30 maxlength=40 value=''></td></tr> <tr><td>County:</td> <td><input type=text name=County size=30 maxlength=40 value=''></td></tr> <tr><td>Postcode:</td> <td><input type=text name=PostCode size=20 maxlength=10 value=''></td></tr> <tr><td>Email:</td> <td><input type=text name=Email size=30 maxlength=64 value=''></td></tr> </table> </form> ... Write the checkRequired function to check all information fields inputted by user (all fields are mandatory).The function must check the validity of every parameter (on the basis of rational acceptability) and make a proper (case-sensitive) formatting for the all form's text fields.
look at my sig, it will get you started. All I can say is if you can not do this without someone's help, then how are you going to do your job? This is an easy thing they asked, could do the whole thing in less then 10 minutes. Eric [ October 12, 2003: Message edited by: Eric Pascarello ] [ October 12, 2003: Message edited by: Eric Pascarello ]
DID YOU EVEN BOTHER TO LOOK AT MY SIGNATURE? I wrote the stupid thing that you need to get a job. You just need to make two simple changes on certain things. If you were capleable of doing those changes then you might deserve the job. Eric
Write the checkRequired function to check all information fields inputted by user (all fields are mandatory). The function must check the validity of every parameter (on the basis of rational acceptability) and make a proper (case-sensitive) formatting for the all form's text fields.