Hi,
At first sorry for my bad english. I installed a form with two fields. In first field I insert a value and i want to search this in a table. When the value is maching with the table field, then i want to display the value of another field of this record into the second field of form. Can someone to help me ?
Than you
Dimitrios
Hi Dimitrios,
How do you want this to work?
If the form is submitted after the first entry then you can use a DB Read to find the second value and display it.
If you want to do this in the browser then you can do it with JavaScript using Ajax.
Bob
Hi Dimitrios,
There are some timing problems here. The Form HTML+PHP you have here is run on the server *before* the form is displayed - so at that point none of the form inputs have any values and the database query will fail.
Also the Student Code presumably only accepts certain values (those in the database table) so you don't want to use a free-form text input there. A select drop-down showing the list of codes might be more useful.
I would suggest that you put the drop-down in the first page of a multi-page form, when that page is submitted use a DB Read action to get the information about the code and show that - with other inputs - in the second page of a form.
It is also possible to do this in one page using JavaScript and Ajax to get the information but this may be too advanced for the moment.
Bob