jquery - javascript mirror dropdown selection in another dropdown -
i have 2 forms on page. 1 hidden initially. later, after first form submitted first hidden , second similar more compact form displayed instead.
i want second form loaded same values submitted in first form, have accomplished, except dropdown, causing me issues.
what i'm trying follows:
<select name = "chooserep" id = "chooserep1" data-param = "required" data-desc = "report" onchange = "document.getelementbyid('chooserep2').options[document.getelementbyid('chooserep2').selectedindex]=this.options[this.selectedindex]"> <option value="">select...</option> <option value="pandl">profit & loss</option> <option value="balsheet">balance sheet</option> </select>
this doesn't seem have effect. have jquery available, option if knows how.
this should set value,
<select name = "chooserep" id = "chooserep1" data-param = "required" data-desc = "report" onchange = "document.getelementbyid('chooserep2').value = this.value;"> <option value="">select...</option> <option value="pandl">profit & loss</option> <option value="balsheet">balance sheet</option> </select>
hope helps.
Comments
Post a Comment