Jump to content

Recommended Posts

 

I am new to Web development. Am using PHP and My SQL Database. I am developing a transport management system. To manage users for the system, I have a combobox (select) which lists the user codes. I have a text box input which I want to display the name (other details from the database) every time the selection changes before submitting the form. How do I achieve this?

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/193978-php-mysql-form-display/
Share on other sites

Hi

we can achieve this by using AJAX.

 

Here is the flow

----------------------

when you change the option in the select box call the javascript function.

you need to build the javascript function which will request to the php file.

php file should take the id and perform the database operations and echo the name.

 

in javascript you will get the response and that response you can assign to the textbox.

 

you try in this way and just search in the net you will get lot of scripts.

 

still if you are not clear how to do let me know with your requirements,i will give the code to you.

 

 

 

 

 

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.