Click to See Complete Forum and Search --> : validating a form
to know
06-17-2003, 05:49 AM
Hello,
ive been trying to validate a form, that when a field is empty an alert would pop up for me, but i only want this for specific fields, not all the fields on the page.
:rolleyes:
Charles
06-17-2003, 05:57 AM
Post a URL for the page with the form and let us know which fields you want to require.
to know
06-17-2003, 06:06 AM
im actually using a software called TMS which has a javascript capability, and subject to each field the handler then is used.
Justin
06-17-2003, 07:49 AM
if(window.document.form_name.form_box.value != ""){whatever you want it to do if it is not empty}
or
if(window.document.form_name.form_box.value== "") {whatever you want it to do if it is empty}
i hope this helps
Charles
06-17-2003, 06:09 PM
Justin's method will not catch fields that have nothing but white space. Dave Clark's method will and as such is a better method to use.
to know
06-18-2003, 03:06 AM
thanks :) dave for the help, im still putting it together as my Jscript is far from amazing, but im getting there.
And once ive done i'll post for you justin, so if you would like to use it.
Thanks once again.
Justin
06-18-2003, 07:14 AM
will get cells that have "" nothing as a var it wi;; show up as 'null'.
if you have something in it when it loads, then put that phrais in the quotes and it will check if it is diffrent from its starting value
the otherway is better, but it is much longer