Re: [PHP-DB] Form question.......
Another way is to refresh the page everytime the user has filled a field in and moves to another: function submit_field( i ) { document.myform.field_to_check.value = "field" + i ; document.myform.submit() ; } The idea is that the "onchange" event is triggered when the user has input something and moves her mouse cursor somewhere else in the form. The javascript passes to the server the name of the field that is to be checked server-side. Supposes you have a consistent naming convention for fields, but you can easily adapt the js function ... Still, Rodrigo's idea of server-side checking every field one at a time does not seem much user-friendly to me. Better normally validate all POST-ed fields server-side upon form submit. - Original Message - From: "Cal Evans" <[EMAIL PROTECTED]> To: "Rodrigo" <[EMAIL PROTECTED]>; "PHP" <[EMAIL PROTECTED]> Sent: Thursday, September 05, 2002 2:58 PM Subject: RE: [PHP-DB] Form question... > That's a toughie. I've done it once where I used a small popup window > (opening it with JavaScript) to go to the server, perform the query to > retrieve the information, stuff it into a JavaScript array and then return > the array to the calling page and close the window. > > It works but the user will see a small window pop-up. > > Other than that, it is possible to use a Java Applet to do it as well. > > HTH, > =C= > > * > * Cal Evans > * The Virtual CIO > * http://www.calevans.com > * > > > -Original Message- > From: Rodrigo [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 04, 2002 7:30 PM > To: PHP > Subject: [PHP-DB] Form question... > > > Hi, i have a question, it may be dumb, but i´m very new with php and mysql, > i need help. > > how can i check a form when i change from one field to another I want > make a condition.if the number i typed is allready in the database, not > just when i finish filling out the hole form...clickin in submit and then > make the conditionshelp heheheh > > > > -- -- > > Rodrigo Corrêa > [EMAIL PROTECTED] > > > > Obs: Sorry about the english, i´m from Brazil...so my english isn´t > good > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Form question.......
Another option would be to break your one form into two separate forms where the first form asks for this number, checks the database, then transfers to user to the next logical page (rest of form or re-enter data) based on the results of that query to the db. I'm not saying it's anywhere near the BEST solution especially of traffic will be heavy, but it's an option. I've seen it used elsewhere (www.2test.com, for example) with varying degrees of success. Basically, if you only do it to your user once, maybe twice, you can get away with it. Any more and you stand the chance of losing your user - especially if the connection speed is slow (56k or slower). Your basic challenge here is that you need to communicate with the db to do the checking you want and that takes a round trip from the browser to the server and back. Basic web-based hurdle, but you have to design to your environment. Then again, maybe somebody else out there HAS already solved this...? Good luck. -Original Message- From: Cal Evans [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 8:58 AM To: Rodrigo; PHP Subject: RE: [PHP-DB] Form question... That's a toughie. I've done it once where I used a small popup window (opening it with JavaScript) to go to the server, perform the query to retrieve the information, stuff it into a JavaScript array and then return the array to the calling page and close the window. It works but the user will see a small window pop-up. Other than that, it is possible to use a Java Applet to do it as well. HTH, =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: Rodrigo [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 04, 2002 7:30 PM To: PHP Subject: [PHP-DB] Form question... Hi, i have a question, it may be dumb, but i´m very new with php and mysql, i need help. how can i check a form when i change from one field to another I want make a condition.if the number i typed is allready in the database, not just when i finish filling out the hole form...clickin in submit and then make the conditionshelp heheheh Rodrigo Corrêa [EMAIL PROTECTED] Obs: Sorry about the english, i´m from Brazil...so my english isn´t good -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Form question.......
That's a toughie. I've done it once where I used a small popup window (opening it with JavaScript) to go to the server, perform the query to retrieve the information, stuff it into a JavaScript array and then return the array to the calling page and close the window. It works but the user will see a small window pop-up. Other than that, it is possible to use a Java Applet to do it as well. HTH, =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: Rodrigo [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 04, 2002 7:30 PM To: PHP Subject: [PHP-DB] Form question... Hi, i have a question, it may be dumb, but i´m very new with php and mysql, i need help. how can i check a form when i change from one field to another I want make a condition.if the number i typed is allready in the database, not just when i finish filling out the hole form...clickin in submit and then make the conditionshelp heheheh Rodrigo Corrêa [EMAIL PROTECTED] Obs: Sorry about the english, i´m from Brazil...so my english isn´t good -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php