HTML/ CSS / JAVASCRIPT

 

HTML/ CSS / JAVASCRIPT


{   Sahelg.com   }    

 

Note); If you have any type of question, comment us or contact>>> imtaizbaloch38@gmail.com)

 

  <html>

 <head>

 <meta http-equiv="Content-Type" content="text/html; charset=iso-88591">

</head>

 <body>

  <b><font face="Verdana"><font size=+1>Form Validation Example:

 Feedback Form</font></font></b> 

 <br><script LANGUAGE="JavaScript"> 

<!—

function ValidateForm(form){

  ErrorText= "";

if (form.username.value == "") {ErrorText= "\nPlease enter your name"}

 

    if ((form.email.value == "" || form.email.value.indexOf('@', 0) == -1) || form.email.value.indexOf('.') == -1){

ErrorText+=     "\nPlease enter a proper value for your email"}

 if (form.feedback.value == "") {ErrorText+= "\nPlease enter your feedback"}

if (ErrorText!= "")

 {   alert("Error :" + ErrorText);        return false;      }

  if (ErrorText= "") { form.submit() } 

 ErrorText= ""; 

if ( ( form.gender[0].checked == false ) && ( form.gender[1].checked ==

false ) ) { alert ( "Please choose your Gender: Male or Female" ); return false; }

if (ErrorText= "") { form.submit() } 

 

ErrorText= "";

 if ( form.age.selectedIndex == 0 ) { alert ( "Please select your Age." );

return false; }

 if (ErrorText= "") { form.submit() }

alert ( "Thank u" ) }

  -->

  </script>

 <br><form name="feedback" action=":imtaizbaloch38@gmail.com" method=post>

<dl> 

<dt>///////////////

 <font face="Verdana">

 <pre>  Please enter the following(To test form validation,

 skip entering one of the fields and click 'Submit' button):  </pre>

  </font>

<font face="Verdana">Name: &nbsp;</font>

<input type="text" value="" name="username" size=30>

</dt><br> 

<br><dt> <font face="Verdana">E-mail: &nbsp;</font>

<input type="text" value="" name="email" size=30>

</dt><br>

<br><dt><font face="Verdana">Your Gender:</font>

  <input type="radio" name="gender" value="Male">   Male

  <input type="radio" name="gender" value="Female">   Female </dt>

<dt> </dt> <br>

  <font face="Verdana, Arial, Helvetica, sans-serif">Your Age</font>:

 <select name="age"> <option value="">Please Select an Option:</option>

<option value="0-18 years">0-18 years</option>

 <option value="18-30 years">18-30 years</option>

 <option value="30-45 years">30-45 years</option>

 <option value="45-60 years">45-60 years</option>

 <option value="60+ years">60+ years</option>

</select>   <br>

<br><font face="Verdana">Feedback:</font>

<dt>

<textarea rows=7 cols=60 name="feedback"></textarea>

</dt>

 </dl>

  <input type="button" name="SubmitButton" value="Submit" onClick="ValidateForm(this.form)">

<input type="reset" value="Reset">

</form>  <pre><font face="Verdana"><font size=+0>&nbsp; &nbsp;</font>

</font>  </pre> 

</form>

 </body>

  </html>

(This is a complete HTML & JAVASCRIPT & CSS project,

Properly read all tags and write it into your Notepad++ or other software)

 

 

 

Post a Comment

7 Comments

Thanks for your feedback we will reply Fast.