Okay I have searched google for hours literally without luck so hopefully someone here can help.

What I am trying to do is when someone submits the form if there are empty textboxes change the textbox's style from class="input" to class="inputreq". Someone please help, the formname is "signup" and the textboxes are "domain" and "username". Please help. Thanks.

If the user does not enter either field and hits submit both the fields will be highlighted. After both have been highlighted, the user fills in ONE of the two fields and hits submit again. It still has the first one highlighted like its empty when its not. How can this be fixed?

You might be able to get by with a loop too. Just use this in place of all of your if-statements. This assumes that your form has only required text boxes; make additional checks if there are optional text boxes:

Hey!
And what is the way to include also <select> tags?
It got the following code, but don't know why the <select> tag doesn't go the same way as the <input> tag does. Both got the same starting value...

Denes - please do not hi-jack and resurrect a long-defunct thread. Prefer to start a new thread of your own. Before you do, remember to have a look at the forum rules and posting guidelines.

Form validation of the pattern if(form1.vorname.value.length == 0) is barely worthy of the name, and virtually useless, as even a single space, an X or a ? will return false, that is pass the validation. Numeric values, such as zip codes and phone numbers, should be validated as such. Ditto email addresses. This topic has been covered many times before in this forum.

Dénes

02-09-2012, 11:03 AM

Ok I'll give my best, go through the code and post my question as a new thread. Give me a chance, it was 3 days ago I began with javascript.