jquery - Changing the name od a dropdown using javascript onchange -
hi need change name of dropdown box depending on selected list.
<form name="dofilter" method="post" action="<%=site_url%>/product"> <select name="ff" onchange="form.submit();"> <option value="">--</option> <option value="brut">brut</option> <option value="moet"> moet</option> </select> </form>
if option brut selected need select name fk , if option moet selected need select name ff
help please
this how did it:
$("form > select").change(function () { $(this).parent().attr("name", $(this).find("option:selected").attr("id")); });
you can check inspecting element see name change instantly.
Comments
Post a Comment