Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form validation set for Email , pin code #172

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions Home.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ <h3>Note: Fields marked with asterisks (<b style="color:rgb(255, 8, 8)"> * </b>)

<!-- form starts -->
<div class="container">
<form action="" class="form1">
<form action="" class="form1" name="form25">
<div class="formheading">
Form 6<br> (See Rules 13(1) and 26) of Registration of Electors Rule-1960
</div>
Expand Down Expand Up @@ -400,7 +400,8 @@ <h3>Note: Fields marked with asterisks (<b style="color:rgb(255, 8, 8)"> * </b>)
class="far fa-keyboard"></i></button><br><br>

Pin Code <sup style="color:rgb(255, 8, 8)"> * </sup> <input class="zoomeffect" type="text" name="" id="pincode"
required onkeypress="return isNumberKey(event);"><br><br>
required onkeypress="return isNumberKey(event);" required pattern="^[0-9]{6}$"><br><br>
<!-- Pin code Validation set -->

State / Union Territory
<sup style="color:rgb(255, 8, 8)"> * </sup>
Expand Down Expand Up @@ -442,14 +443,14 @@ <h3>Note: Fields marked with asterisks (<b style="color:rgb(255, 8, 8)"> * </b>)

<br>

Email ID (optional) <input class="zoomeffect" type="text" name="" id="" required><br><br>
Email ID (optional) <input class="zoomeffect" type="text" name="text1" id="" required><br><br>

Mobile No. (optional)

<span>+91</span>


<input class="zoomeffect" type="text" name="input" required><br><br>
<input class="zoomeffect" type="text" name="text2" required><br><br>

</div>
<!-- form part 4 ends -->
Expand Down Expand Up @@ -736,7 +737,8 @@ <h3>Note: Fields marked with asterisks (<b style="color:rgb(255, 8, 8)"> * </b>)
<div class="myBtn">

<input type="reset" class="btn btn-success" value="Reset">
<input type="submit" class="btn btn-success" value="Submit" id="submitButton">
<input type="submit" class="btn btn-success" value="Submit" id="submitButton"
onclick="ValidateEmail(document.form25.text1); ">
</div>
</form>
</div>
Expand Down Expand Up @@ -768,11 +770,11 @@ <h3>Note: Fields marked with asterisks (<b style="color:rgb(255, 8, 8)"> * </b>)

</script> -->

<script>
<!-- <script>
$("input#submitButton").click(function () {
alert("Form successfully submitted");
});
</script>
</script> -->



Expand Down Expand Up @@ -1468,6 +1470,23 @@ <h3>Note: Fields marked with asterisks (<b style="color:rgb(255, 8, 8)"> * </b>)
})
</script>
<script src="js/video.js"></script>
<!-- script for email-validation -->
<script>
function ValidateEmail(inputText) {
var mailformat = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
if (inputText.value.match(mailformat)) {
alert("Valid email address!");
document.form1.text1.focus();
return true;
}
else {
alert("You have entered an invalid email address!");
document.form1.text1.focus();
return false;
}
}

</script>
</body>

</html>