blakewilliams Posted June 28, 2010 Share Posted June 28, 2010 Hi ev1 - this is my first post! Basically I'm relatively new to php, I know the basics and have made some pretty cool stuff with php already - but I am currently fascinated by executing and validating forms. I'm very fluent in html, css and know enough javascript/jquery to get by and I also understand how mail forms are executed in their most basic sense, but thats not essentially what I'm getting at. I know there are literally hundreds of techniques for doing this, but nobody ever seems to agree. I'm looking for the best solution to combine client side and server side validation to validate and execute something like a log in form that is done in the most effective and efficient way. So far I'm thinking that making the form submit its self and checking with javascript to see if the fields are valid before changing a 'return false', the on to the php code. Any help much appreciated here - love to hear all of your methods... lots of code please - links to tutorials or similar threads much appreciated! Cheers Blake Quote Link to comment https://forums.phpfreaks.com/topic/206072-form-execution-and-validation-vut-the-bull-lets-find-the-best-way/ Share on other sites More sharing options...
mrMarcus Posted June 28, 2010 Share Posted June 28, 2010 Javascript is fine for instant validation, but is not dependable. What I mean by that is that Javascript can be turned off, so your main focus is on PHP validation of the incoming form data. With that said, your thought to, "combine client side and server side" should not implemented. They should remain two separate entities. Quote Link to comment https://forums.phpfreaks.com/topic/206072-form-execution-and-validation-vut-the-bull-lets-find-the-best-way/#findComment-1078249 Share on other sites More sharing options...
blakewilliams Posted June 28, 2010 Author Share Posted June 28, 2010 I thought it was common practice to use client side and server side validation. So basically, if I see a nice error message that appears without a page refresh, that isn't necessarily javascript validation, just a client side effect to show the results of the php validation? Quote Link to comment https://forums.phpfreaks.com/topic/206072-form-execution-and-validation-vut-the-bull-lets-find-the-best-way/#findComment-1078256 Share on other sites More sharing options...
trq Posted June 28, 2010 Share Posted June 28, 2010 if I see a nice error message that appears without a page refresh, that isn't necessarily javascript validation, just a client side effect to show the results of the php validation? In terms of a login page, it would be both (Ajax) client-side and server-side. http://www.jformer.com is a nice little jQuery based lib that Ive been using a little lately which has been nice. There's not much documentation around but the examples are good enough. Quote Link to comment https://forums.phpfreaks.com/topic/206072-form-execution-and-validation-vut-the-bull-lets-find-the-best-way/#findComment-1078259 Share on other sites More sharing options...
blakewilliams Posted June 28, 2010 Author Share Posted June 28, 2010 Yeah its nice - thats the kinda thing I would like to achieve, I'd rather learn it frmo the bottom up though. What is your preferred method - can I take a look? Quote Link to comment https://forums.phpfreaks.com/topic/206072-form-execution-and-validation-vut-the-bull-lets-find-the-best-way/#findComment-1078291 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.