PhilAJ,
quote:
Surely if DW is creating this then it should aways work ?
It would be nice, wouldn't it? ;-)
There are two basic types of validation - client-side and
server-side.
Client-side validation uses JavaScript, in this case the code
that DW generates, but you are dependent on the user's browser
settings. It happens on the user's machine before anything is sent
back across the Internet to your web server. If they want to turn
off JS, they can.
Server-side validation takes place on the server with the
data sent from the user. webpro2k has provided you with a nice bit
of code to test whether those fields come in blank. If they do, you
can decide what to do with the user's interaction. Instead of the
Thank You page, or wherever you may have sent them after a
successful submission, you could send them back to the form
indicating the fields they neglected to fill out and pre-populating
those they already filled out with the data from the first
submission.
Best practice is to do both client-side (in theory it reduces
user frustration if done right.) and server side (to ensure clean
data). It takes a little extra work. You know your audience and
your needs, so you can do the cost/benefit analysis.
Regards,
Bob