|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hello
Looking for a simple script example for PHP validation on form with AJAX. Yes, I've google this many times over and there are a lot of different AJAX frameworks to work with. Simple form where values/input is validated by a PHP script. Thanks greatly |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Angela wrote:
> Hello > > Looking for a simple script example for PHP validation on form with AJAX. > > Yes, I've google this many times over and there are a lot of different > AJAX frameworks to work with. > > Simple form where values/input is validated by a PHP script. > > Thanks greatly > Never depend on client-side anything for validation. You can use javascript to validate client-side, but when the user submits the data, you *must* validate it server-side to be safe. AJAX has nothing to do with the latter. It's just standard PHP validation techniques. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Sat, 03 Nov 2007 13:11:44 -0500, Jerry Stuckle wrote...
> >Angela wrote: >> Hello >> >> Looking for a simple script example for PHP validation on form with AJAX. >> >> Yes, I've google this many times over and there are a lot of different >> AJAX frameworks to work with. >> >> Simple form where values/input is validated by a PHP script. >> >> Thanks greatly >> > >Never depend on client-side anything for validation. > >You can use javascript to validate client-side, but when the user >submits the data, you *must* validate it server-side to be safe. > >AJAX has nothing to do with the latter. It's just standard PHP >validation techniques. > You could use AJAX to display interactive messages and validate some of the data, but like Jerry mentioned, it is unreliable. Use your PHP to validate the information at the server whether or not you use AJAX to manage the data on the client side. Tom -- NewsGuy Free Trial Accounts Now a massive 20 Gigabytes of unrestricted downloads ! http://newsguy.com/ |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
That's extactly what I am wanting to do.
Use Javascript/AJAX to display the error messages for user and use PHP (server side) to do the validation (regex, check db, etc). Purpose of looking at AJAX is because this is all done in 'real time' (asonychronous) Anyone with any simple examples? ![]() Tom wrote: > On Sat, 03 Nov 2007 13:11:44 -0500, Jerry Stuckle wrote... >> Angela wrote: >>> Hello >>> >>> Looking for a simple script example for PHP validation on form with AJAX. >>> >>> Yes, I've google this many times over and there are a lot of different >>> AJAX frameworks to work with. >>> >>> Simple form where values/input is validated by a PHP script. >>> >>> Thanks greatly >>> >> Never depend on client-side anything for validation. >> >> You can use javascript to validate client-side, but when the user >> submits the data, you *must* validate it server-side to be safe. >> >> AJAX has nothing to do with the latter. It's just standard PHP >> validation techniques. >> > > You could use AJAX to display interactive messages and validate some of the > data, but like Jerry mentioned, it is unreliable. Use your PHP to validate the > information at the server whether or not you use AJAX to manage the data on the > client side. > > Tom |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
Angela wrote:
> That's extactly what I am wanting to do. > > Use Javascript/AJAX to display the error messages for user > and use PHP (server side) to do the validation (regex, check db, etc). > > Purpose of looking at AJAX is because this is all done in 'real time' > (asonychronous) > > Anyone with any simple examples? > > ![]() > > Tom wrote: >> On Sat, 03 Nov 2007 13:11:44 -0500, Jerry Stuckle wrote... >>> Angela wrote: >>>> Hello >>>> >>>> Looking for a simple script example for PHP validation on form with >>>> AJAX. >>>> >>>> Yes, I've google this many times over and there are a lot of >>>> different AJAX frameworks to work with. >>>> >>>> Simple form where values/input is validated by a PHP script. >>>> >>>> Thanks greatly >>>> >>> Never depend on client-side anything for validation. >>> >>> You can use javascript to validate client-side, but when the user >>> submits the data, you *must* validate it server-side to be safe. >>> >>> AJAX has nothing to do with the latter. It's just standard PHP >>> validation techniques. >>> >> >> You could use AJAX to display interactive messages and validate some >> of the >> data, but like Jerry mentioned, it is unreliable. Use your PHP to >> validate the >> information at the server whether or not you use AJAX to manage the >> data on the >> client side. >> >> Tom > And what happens when people have javascript disabled? Javascript should be used to *enhance* the experience, not be *required* by the experience. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
..oO(Angela)
>That's extactly what I am wanting to do. > >Use Javascript/AJAX to display the error messages for user >and use PHP (server side) to do the validation (regex, check db, etc). JS is optional and not always available. Do you want such a critical thing like error messages just be an "optional feature"? >Purpose of looking at AJAX is because this is all done in 'real time' >(asonychronous) > >Anyone with any simple examples? Why not start simple with the most typical and most reliable way of validating the form data on the server and displaying the form it again with inline error messages if something was wrong? _After_ that is working properly, you _could_ add some client-side stuff to pre-validate fields before the form is submitted. This doesn't have to be done with "AJAX" - plain JS is enough in many cases. Micha |
|
![]() |
| Outils de la discussion | |
|
|