![]() |
Best way to validate forms?
Does anyone have any tricks/tips on validating forms (no plugins)?
There doesn't really seem to be any universal way to make a javascript function that will suit everything, you almost have to hard code form/input names into the function, which is nasty if you're going to be working with a lot of forms in a project. I mean I could make something that checks for empty fields or validates an email address but what if I need to see if a <select> listbox value=="this" and if it does then make sure this <input> field=="this".. things would get really messy.. |
Plus you have to worry about people doing malicious things and getting past your javascript validation so you have to also pass everything through PHP or something.
|
|
jquery has some nice ones
|
jquery - I guess that's it.
|
Of course... I'm becoming very familiar with jquery now lol. Still kind of have the same problem though, I guess there will just have to be another function for every form? Gross..
|
Quote:
|
Ok I have like 20 jquery.com pages open trying to figure out how to do this but none of them work, lets say I have a few of these:
Quote:
I think the closest I've came is: Quote:
|
I can get the value of a <select> just fine, but since I have many of them stored into an array it's made this a lot more difficult.
|
LOL I think I finally stumped everyone. I did find a solution though:
Quote:
|
All times are GMT -7. The time now is 06:24 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123