Hi all,
I have a JavaScript function that checks values have been added to textboxes on button click. If no values have been added then the backgrounds are changed to red, a message is added and false is returned. If they have then true is returned. I am having problems getting the correct JQuery syntax function. At the moment i do this...Any help appreciated.
Thanks,
L
Age is a consequence of experience
I have a JavaScript function that checks values have been added to textboxes on button click. If no values have been added then the backgrounds are changed to red, a message is added and false is returned. If they have then true is returned. I am having problems getting the correct JQuery syntax function. At the moment i do this...Any help appreciated.
Code:
function valSubmit() {
var doc = document.forms[0];
var msg = "";
if (doc.TxtYourName.value == "") {
msg += "- Please enter your name";
document.getElementById('TxtYourName').style.background = '#FBBBB9';
} else {
document.getElementById('TxtYourName').style.background = '#fff';
}
....
if (msg == "") {
var tempLabel = document.getElementById('lblerrormessage');
tempLabel.innerText = "Please wait, sending....";
return true;
}
else {
return false;
}
}
Thanks,
L
Age is a consequence of experience