Forum Moderators: open

Message Too Old, No Replies

How do I populate a form from database and update database on one page

         

esscher

3:49 am on Feb 23, 2008 (gmt 0)

10+ Year Member



Without going into great detail (which I can do if it turns out more info is needed), I would like to:

All on one page, using ajax:
1. In a text field, have the user enter a plant name to insert into a database
2. Have a form pop up with attributes for the plant (name, scientific name, related species)
3. Have the user fill this field out and submit it to a mysql database table.

So far I have part 1 and 2 working. However, I cannot figure out how to continue to part 3 without submitting the data and loading to the next page for confirmation of insertion.

I can provide further information and source if it is needed. Thanks

Esscher

[edited by: tedster at 5:13 am (utc) on Feb. 23, 2008]
[edit reason] no personal links, thanks [/edit]

Brett_Tabke

3:15 pm on Feb 25, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Hi,

I would look at scripts that have "username" lookup or live searches. There are several "google suggest" like scripts out there that will silently submit a form to check for validity. The most famous of those, are the scripts that check to see if a username is available.

Go to this demo page from the perl cgi module (doesn't matter that it is perl - we want to look at the javascript anyway):
[perljax.us...]

Try the radio button example. See how it silently submits the form based upon the click? The principle is exactly the same as what you are looking for in #3.