<form role="form" class="search-form" >
<div class="form-group">
<input required type="email" class="form-control"
id="search" name="search"
placeholder="Enter your email">
<button id="gotoNext" name="gotoNext" onclick="fnNext()" class="btn btn-theme" type="button">
Get Started <i class="fa fa-chevron-right"></i>
</button>
<br />
<label style="color:white;">Your Information is safe & secure</label>
</div>
</form>
<script>
function validateEmail($email) {
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
return emailReg.test($email);
}
function fnNext() {
$('#gotoNext').click(function () {
var email = $('#search').val();
var url = '../Quote/BondInfo?search=' + email;
if (email == '')
{
alert("Invalid Email. Please try again!");
}
else if (!validateEmail(email))
{
alert("Invalid Email format. Please try again!");
}
else
{
localStorage.setItem('email', email);
window.location.replace(encodeURI(url));
}
});
}
</script>
$('#gotoNext').on('click',function () {
var email = $('#search').val();
var url = '../Quote/BondInfo?search=' + email;
if (email == '')
{
alert("Invalid Email. Please try again!");
}
else if (!validateEmail
<form role="form" class="search-form" >
<div class="form-group">
<input required type="email" class="form-control"
id="search" name="search"
placeholder="Enter your email">
<button id="gotoNext" name="gotoNext" class="btn btn-theme" type="button">
Get Started <i class="fa fa-chevron-right"></i>
</button>
<br />
<label style="color:white;">Your Information is safe & secure</label>
</div>
</form>
function validateEmail($email) {
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
return emailReg.test($email);
}
$('#gotoNext').click(function () {
var email = $('#search').val();
var url = '../Quote/BondInfo?search=' + email;
if (email == '')
{
alert("Invalid Email. Please try again!");
}
else if (!validateEmail(email))
{
alert("Invalid Email format. Please try again!");
}
else
{
localStorage.setItem('email', email);
window.location.replace(encodeURI(url));
}
});