fill input from select not working
Hi !
I want to fill an input type=text from a selected value, there is no js error on the page but my code is not working, input keeps empty
I have tried with name or id : same result
thank you
- <script>jQuery(function ($) {$("select[name='selectGroupIds']").change(function() {
- $("input[name='jform[user_ids]']").eq($(this).index()).val(this.value);
- }).change();
- }); </script>
- <input type="text" name="jform[user_ids]" id="jform_user_ids" value="" class="inputbox">
- <select id="selectGroupIds" name="selectGroupIds" aria-invalid="false">
- <option value="">Select group</option>
- <option value="79,173,244,82,292,81,119,161,83,1428,231">group 1</option>
- <option value="533,126,346,164,108,242,805,291,359">group 2</option>
- <option value="286,325,157,288,1234,209,283,150,387,287,260">group 3</option>
- </select>