I am looking for a bit of logic.
my goal is to select a record in my database with select/option tag so two columns can be pulled and echoed into input tags so they can be updated and then save back to the databse.
By the sound of it this is a job for AJAX - once you’ve selected a record from your select/option tag, you want to fire off a request to the server to return the data from that record and use it to populate the rest of your input form.
You could do it as a two-part form - the first form would just display the select/option list and have a “next” button, and the next button would send the selection to your PHP code which would select the record, and draw the remainder of the form with the data in it. You’d probably need a ‘back’ button as well to return to the selection.
Either would do the job, I would think the AJAX option would be the preferred method now. Plenty of tutorials on AJAX around if you’re not clear on any of it.
I been reading about AJAX and failed to see the point of using AJAX over regular POST? if I give my submit button for the first form where the select tag reside a name like let’s say “open” and then check to see if that button has been submitted and then get the $_POST value from the select box and echo it in my input tags, doesn’t that do the exact same?
The benefit of using AJAX is that it can save the user a page refresh.
ok, this answers my question. thank you very much both of you.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.