PDA

View Full Version : More form junk...



Stevens
11-04-2003, 01:56 PM
Can I use a submit button in an HTML form to run PHP code on the current page without reloading the page completely after hitting submit?

Example...I have the following HTML...


<input type="text" name="excess1">
<input type="submit" name="verify1" value="Verify ->">
<input type="text" name="model1">

The purpose here is to verify that the information entered in the "excess1" text box is correct. When the info is entered and the "verify1" button is hit, I want a quick lookup to my db to be done and the appropriate info to populate the "model1" text box. The problem is that I have 9 other sets just like this that is going to be part of the same form for submittal. Can the form be handles without reloading the entire page?

E

Mike
11-04-2003, 02:22 PM
Frames is the only way I can think of, although I'm sure there will be a better alternative.

Stevens
11-04-2003, 02:28 PM
You know the scripts that I stick in there will STILL have to query the database so reloading the page is inevitible. See, after I stick in the 10 rows of information and it is verified, I have another submit button that will take all "excess" entries and update the corresponding records. I guess it's an HTML form thing that I need to look into rather than php...

Chris
11-04-2003, 03:15 PM
php is server side, you can't process it without access the server.

Javascript can do form verification on the client side and is often used for just that purpose. If you search on Google for "javascript form verification" you'll probably find loads of info. Or if you have a good javascript book there is probably an example in it.

Stevens
11-05-2003, 07:09 AM
cool...thanx...