route validation and prevent navigation from breaking on re-cklick

This commit is contained in:
Joe
2017-02-07 21:55:04 -06:00
parent b557c002ae
commit cb3e4ca7a0
7 changed files with 68 additions and 27 deletions

View File

@@ -2,13 +2,13 @@
function checkEMail(theEmailAddress){
return (/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/.test(theEmailAddress));
}
function nextHandler(){
$("#alertInvalidEMail").addClass("hide");
if(checkEMail($($('[name="email"]')[0]).val())){
window.location="#Sell/page2/";
window.location="#Sell/page2/";
} else {
console.log("EMail Wrong");
if (ibuyproperties.isDebugMode) { console.log("EMail Wrong"); }
$("#alertInvalidEMail").removeClass("hide");
}
}
@@ -18,13 +18,13 @@ function nextHandler(){
<div id="alertInvalidEMail" class="alert alert-danger hide" role="alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span class="sr-only">Error:</span>
Enter a valid email address
A valid email address is required.
</div>
<div class="input-group" style="width:100%">
<span class="input-group-addon fixWidth1 fieldLabel" >First Name</span>
<input type="text" name="firstName" class="form-control"/>
</div>
<div class="input-group" style="width:100%">
</div>
<div class="input-group" style="width:100%">
<span class="input-group-addon fixWidth1 fieldLabel">Last Name</span>
<input type="text" name="LastName" class="form-control"/>
</div>
@@ -34,8 +34,8 @@ function nextHandler(){
<span class="input-group-addon fieldLabel">
Preferred <input type="checkbox" name="prefEmail"/>
</span>
</div>
<div class="input-group">
</div>
<div class="input-group">
<span class="input-group-addon fixWidth1 fieldLabel" >Phone</span>
<input type="text" name="phone" class="form-control"/>
<span class="input-group-addon fieldLabel">