|
JavaScript: Validation problems. Need to check for dots in form.
I have a form with three textboxes that I need to check that they don’t contain any dots (“.”). Thus the following combinations, for example, should return false (3434.3356) (.sdfsah.sdlfsdf) (pdhhpp.4235) All strings that contain a dot (or several) in any way should return false. How can I check for that? I have this code already and would appreciate if you could add to that, because I don’t know how to interpret and read regular expressions.
function check(){
if(document.form1.text1.value==""){ alert("You have a blank box"); return false; }
else if
// here I don’t know how to continue to check that there are no dots in the text box.
else
{ return true; }
}
|