Jump to content

Form execution and validation - vut the bull, lets find the best way!


blakewilliams

Recommended Posts

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

 

 

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.

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?

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.

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.