2

Want to create chained textbox :

textbox1            textbox2             textbox3
_________           ____________       _____________
|___A____|         |(1)disabled|       |(a)disabled|

textbox1(value):A,B,C,D,E; 
textbox2(value):1,2,3,4,5; 
textbox3(value):a,b,c,d,e; like-> "A,1,a","B,2,b"=> this will be the combination

Where selecting the value of textbox1,corresponding value to textbox1 will appear in textbox2,so as in textbox3 w.r.t textbox3.And my predefined value will be stored in jQuery function,on calling it will fill the value.

Suggestion.... needed

2
  • do you mean selectBox or textArea, try to improve you aceept rate
    – mgraph
    Jun 2, 2012 at 10:50
  • 1
    Hiya, You should really think of improving your accept ratio, and please attach some code as well that usually help us to help you man, cheers!
    – Tats_innit
    Jun 2, 2012 at 10:51

2 Answers 2

1
$(".chainbox").on("keyup", function(){
    $(".chainbox").val(this.value);
});​

DEMO 1

I think you want a selectbox instead of checkbox (not sure)

$(".myselect").on("change", function(){

    // here I update value of next select box 
    // using current selectbox value
    // may be you have something else

    $(this).next('.myselect').val(this.value).prop('disabled', false);
});​

DEMO 2

If you want to show the selected text of first select to next two text box then:

$(".myselect").on("change", function(){
    $(this).nextAll(':input.mytext').val($('option:selected', this).text());
});

DEMO 3

5
  • It seems to me he want the selected text in textbox 1 to show up in textbox 2 and 3. No? Jun 2, 2012 at 11:16
  • >thecodeparadox : I want textbox (in 3 cases)
    – Tirtha
    Jun 2, 2012 at 11:20
  • @Vivekanand then first demo should work for you Jun 2, 2012 at 11:21
  • @Vivekanand don't understand anything? describe in your question everything, not in comment Jun 2, 2012 at 11:27
  • @Vivekanand what wrong with my answer? may i know Jun 13, 2012 at 14:12
1

working demo http://jsfiddle.net/Mwkjs/10/

Please let me know if I missed anything.

So you can use change or keydown apis as well.

Hope this help!

jquery code

$(".foo").on("keyup",function(){
    $(".foo").val($(this).val());
});​

Not the answer you're looking for? Browse other questions tagged or ask your own question.