function chkValidEmail() {
var email = document.touristSurvey.userEmail.value;
var exptext = /^[A-Za-z0-9_\.\-]+@[A-Za-z0-9\-]+\.[A-Za-z0-9\-]+/;
if(exptext.test(email)==false){
//Email format is Alphabet+Number@Alphabet+Number.Not in alphabetic + numeric format
alert("The Email format is invalid.");
return;
}else{
chkEmail();
}
}
function chkEmail(){
var chk=false;
if(document.touristSurvey.userEmail.value != ''){
var userEmail = $("#userEmail").val();
$.ajax({
url: "emailChk.or",
type: "POST",
data: {"userEmail" : userEmail},
dataType:"text",
cache: false,
success: function(result){
if(result!="0") {
alert("The email is duplicated.");
return;
}else{
submitOn();
}
}
});
}
}
function submitOn(){
document.getElementById("submit_btn").innerHTML = "On saving... Please wait.";
document.touristSurvey.submit();
}
It's a strip that checks your email
DB is writing msql.
Most of the double check by e-mail and receiving it in the DVD is going well, but...
We found that we received duplicate emails. (This is about 1/100)
I don't know why. <
javascript ajax jquery
In MySql, set unique constraint
in the email
column.
This is because the timing of checking for duplication and the time of actual insert
are different.
The storage stage must guarantee that it is unique.
887 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
567 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
577 PHP ssh2_scp_send fails to send files as intended
599 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.