javascript - Auto submit form cannot show up the selection option properly -
problem form selection box.
i working on form , try make auto-submit once choose option.
i have following codes:
<script> function target_popup(form) { w = window.open('', 'metas_pop', 'width=600,height=400, resizable, scrollbars'); form.target = 'metas_pop'; w.focus(); } </script> <script src="gen_validatorv4.js" type="text/javascript"></script> <script src="jquery-3.0.0.js"></script> <link rel="stylesheet" type="text/css" href="osce_style.css">
and in form:
<form action="" method="post"> <select style="color: red; font-size: larger" name='examiner_role' onchange='this.form.submit()' onselect='<?php $examiner_role=$_post['examiner_role'];?> <option style="color: red; font-size: larger" value="1">examiner 1</option> <option style="color: red; font-size: larger" value="2">examiner 2</option> <option style="color: red; font-size: larger" value="3">examiner 3</option> </select> <noscript><input type="submit" value="send"></noscript>
the selection box works options availble. can select option correct value store expected variable $examiner_role. however, everytime choose option, box automatically goes first line of options. how can make stays , show option chooes?
you submitting
form onchange
of dropdown page refreshes
, option
goes first one
.
remove onchange
event dropdown
because have separate submit button
.
<select style="color: red; font-size: larger" name='examiner_role' onselect='<?php $examiner_role=$_post['examiner_role'];?>
just remove onchange='this.form.submit()'
Comments
Post a Comment