When i select some data from my option i need the value to be showed when “onchange” the select… can someone help me ?
<select name="search_school" id="search_school" onchange="$('#search_school').val() = $('#school_name').val()">
I want the selected option value to be showed in the hidden input
<input type="hidden" name="school_name" id="school_name" value="" />
I think you want this as your onchange event:
When you call
val()without a parameter, it fetches the value of the element. If you call it with a parameter likeval('some value');, it sets the value of the element.