Jump to content

Any web programmere here - javascript validation experience?


Aza

Recommended Posts

I am currently building a site for my dad, but am having extreme frustration on validating a form. I have it all set out and the form emails the results to you via php.

However, I need to validate the form so that a blank submission and credentials are checked...

Can anyone help please??

Link to comment
Share on other sites

Yeh mate - cheers for your reply ;)

I think I have actually figured something after literally 4.5hours straight :S

I have had a series of JScript validation techniques in the <head> section of my page, for some reason the form would check the validation, but even after saying "Error" it would still proceed to submission.

You only realise how delicate code is afterwards and how such a minor change is the difference between succss & failure. I figured that I was missing something..

return false ;

}

return true ;

I missed out the "return false" bits which essentially exit the validation and prevents the form submitting. Also I needed "onsubmit="return title of your javascript(form)".

Think I have enough to carry on now - unless you know any shizzle scripts for validating typical fields in a contact form ;

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...