View Full Version : validate input text with predeterminate value

10-19-2006, 12:56 AM
I have an input text with value=Lois so I want to validate this input. If some user enter another word different of Lois will give an alert, and if in the field one writes the word Lois (without importing capital letters or minuscule) the form can be executed in correct form.


Philip M
10-19-2006, 09:34 AM
I am not sure that I understand what is intended here,

function checkForLois(which) {
var theName = which.value;
if (theName != "Lois") {
alert ("You must enter 'Lois' in this box to proceed");
return false;

onsubmit = "checkForLois(this)"