The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

simple validation

Please excuse my ignorance, but I just can't get Javascript at all.

I'm trying to write some validation for a field called Propid, in a form called qSearch. Basically if there's nothing in Propid, or it is says "ref no.", I want to alert the user, otherwise, I want the form to submit.

qSearch.Propid isn't the best way to get a reference to a form element
I prefer document.getElementById(elem_id)

And; shouldn't ... !="ref no."... be ... =="ref no."... ?
But what happens if the text is "ref no" or "ref n" etc?
Conclusion; you need another method to check that the textbox contains a valid Propid, e.g. check if the text ends with a numeric value