I am using Jquery dialog box. There are two dialog boxes div1 and div2. There are 8 textboxes in div1 and I would like to update a specific textbox, txt6 when I change a value in div2.
I’ve tried the following but didn’t work.
$("#div1.txt6").val('test');
Please let me know what I’m missing here.
Use jQuery custom events as follow:
When you change the value in div2, trigger an event:
$('#div2').val('something').trigger('valueChanged', { value: 'something' });In div1, subscribe to this event:
$('#div2').bind('valueChanged', function(e, args) {$('#txt6').val(args.value);
});