Jump to content

sharon5467

Members
  • Posts

    3
  • Joined

  • Last visited

sharon5467's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. HiI am trying to create the below form without much success. Please can anyone provide any tips or pointers of what I am doing wrong?<html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><script LANGUAGE="JavaScript" type="text/javascript"><!-- hide javascript codevar justValidating = truefunction validateForm(form) //validate assessment data { if (!validateStudentNumber(form.studentNum.value)) // student number valid? { form.studentNum.focus() return false }if (justValidating) // only show alert box if validating, and not submitting alert("Well Done: Your data is valid!") // all data validated return true }function validateStudentNumber(studentNum) { var myRegexp = /^[A-Z]{2}\d{7}/ if(myRegexp.test(/^[A-Z]{2}\d{7}/)) } alert("Please enter two letters before seven digits!") return false } return true }// end javascript hide --></SCRIPT></head><BODY BGCOLOR="white" TEXT="blue" onLoad="window.defaultStatus='JavaScript Assessment Frame'"><CENTER><H2>JavaScript Assessment</H2> <FORM NAME="assessForm" METHOD="post" ACTION="mailto:skinton11@yahoo.co.uk" onSubmit="justValidating=false; return validateForm(assessForm)"> Student Number: <INPUT NAME="studentNum" TYPE="text" SIZE="12" maxlength="9"> <INPUT TYPE="submit" VALUE="Submit"> <INPUT TYPE="button" VALUE="Validate" onClick="justValidating=true; validateForm(this.form)"> <INPUT TYPE="reset" VALUE="Reset"></FORM></body></html>Anyone have any suggestions??Many ThanksSharon
  2. Many thanks for that, its a great help.Sharon
  3. Hi I am trying to use create a validation form where I have a text box that the user has to enter two letters before digits, how can this be accomplished?Please help!!!Many Thanks
×
×
  • Create New...