Jump to content

extracting information from a mysql table


chrisjwebb1978

Recommended Posts

HI all I have a page that allow individuals to use a select drop down box to choose from a number of items for an invoice. What i would like to happen, is when an item from the list is chosen, the current number in stock generates in a disabled text box to the right. This obviously needs to happen before form submission, but i am a newbie at javascript and need to have it work alongside php. Any guidance is appreciated.

Link to comment
Share on other sites

The simplest way is to add a hidden input that will hold that value, give the input an id, target that id with an event attached to the form, and change it with getElementById(). EDIT: You can store the item's value in $_SESSION instead of a table.

Edited by niche
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...