Jump to content

Filling Text Box Based On Comboselected Value!


saravanataee

Recommended Posts

Dear Members,

I have a doubt.

 

I am having a table with three fields ItemName,Packing,Quantity.

 

Each item has list of Packing's like Small,Medium,Large. And Each packing has size like 50,100,200.

 

When i select ItemName from Combo1, My Combo2 Packing should be showing what all packs for that particualr item available and then show the size of that particular pack in textfield.

 

In php form:

 

ItemName: combo1

Packing: combo2

Quantity: textbox1

 

when combo1 selected values of combo2 must be changed based on combo1 selection.

when combo2 has particular pack, textbox should display only quantity defined for that particular pack..

 

Can anyone suggest me how can proceed on this ..

 

I knwo javascript is the only way. But i m not expert in it.

 

referr me to some demo or example or piece of code from where i can get idea..

 

Thanks!

Link to comment
Share on other sites

You can use ajax for this....call ajax when first combo1 is selected and based on this value fill the second combo...

 

Again call ajax for the second combo and fill the value in the textbox based on the name you selected in the combo box...

 

You will get many sample by searching google (populating dropdown using php/mysql) or refer below url

 

http://buffernow.com/demo/cascadedrpdwn/

Link to comment
Share on other sites

Hi Sowna,

The example link you have given is awesome. It is exactly similar to what i have been looking for, but only change is that i needed a text box instead of third combo box. Anyway, Can i get some sample code for such ajax call usage. Becuz i have not done that before. Since no idea on how to proceed further.

 

If you provide me some example code, it will be great full.

 

Thanks!!

Link to comment
Share on other sites

  • 4 weeks later...
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.