Butterflyland
08-11-2007, 12:10 PM
Hi there,
Great forum :)
I am need of some help. I am a designer and my coder is unavailable today.
I am using some Ajax for form validation but I have one element I need to change and don't have the knowledge to do this.
This is what I currently have:
if ( posText.value == '' || whiteSpace.test(posText.value) ) {
alert("You're trying to send an Empty Email. Please type something and then get on your way.");
}
else if ( posEmail.value == '' && strCC.checked == true ) {
alert("Why are you trying to CC yourself without an email?");
}
else {
sendPosEmail();
}
}
but I really want to do this inline like my existing alerts. Here is the code I have for posText, but it does not allow for CC alert.
} else if ( posText.value == "" || whiteSpace.test(posText.value) ) {
document.getElementById("emailSuccess").style.display = "none";
hideAllErrors();
document.getElementById("messageError").style.display = "inline";
document.getElementById("posText").select();
document.getElementById("posText").focus();
} else {
hideAllErrors();
sendPosEmail();
}
}
My code can be seen in full here: http://snipplr.com/view/3506/my-complete-contactjs/
Can anyone possibly help?
Thank you
Karl
Great forum :)
I am need of some help. I am a designer and my coder is unavailable today.
I am using some Ajax for form validation but I have one element I need to change and don't have the knowledge to do this.
This is what I currently have:
if ( posText.value == '' || whiteSpace.test(posText.value) ) {
alert("You're trying to send an Empty Email. Please type something and then get on your way.");
}
else if ( posEmail.value == '' && strCC.checked == true ) {
alert("Why are you trying to CC yourself without an email?");
}
else {
sendPosEmail();
}
}
but I really want to do this inline like my existing alerts. Here is the code I have for posText, but it does not allow for CC alert.
} else if ( posText.value == "" || whiteSpace.test(posText.value) ) {
document.getElementById("emailSuccess").style.display = "none";
hideAllErrors();
document.getElementById("messageError").style.display = "inline";
document.getElementById("posText").select();
document.getElementById("posText").focus();
} else {
hideAllErrors();
sendPosEmail();
}
}
My code can be seen in full here: http://snipplr.com/view/3506/my-complete-contactjs/
Can anyone possibly help?
Thank you
Karl