Tough Form Challenge for me...
Thanks in advance for your help, but I need some help/advice here for my work-related problem that I'm still googling and trying to find examples, links would be appreciated.
The form has 2 text boxes along with empty text boxes for form data, and the database already has some data, but the user wants to use the same data in the form, for example, clientele data. The Client would enter a 6 digit code, then click on Retrieve, once the retrieve button is clicked, A Database connection is established and the record based on that 6 digit code is retrieve and the data is populated on the form, then the user can just click on send and the form is validated automatically on client then server side, once all validations has been passed, the form is emailed to us.
Can anyone help with this or offer advice please? Thanks in advance!
I hope the 6 digit code is a unique code in your database table.
Once user submits 6 digit code and click on retrieve you need to call a query that actually retrieves the records from the database like below:
e.g., your code: 123456
Then in the form input fields call the respective field values. Since this form is in same page, you can use ajax submit so the page wont reload again.
$code = 123456;
$query = mysql_query("Select * from your_table where code='$code'");
$result = mysql_fetch_array($query);
Hope this helps!
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)