php - How to get dropdown value based on class name -
i want dropdown value based on class name
<select name="changestatus" class="changestatus1" id="changestatus1" onchange="business_type('1')">
because of reason don't want value through name($_post['changestatus'];).
i want through class name.
here how it, add together hidden input field , when form submit, modify value of hidden input field.
<form id="myform"> <input type="hidden" name="hidden_input" id="hidden_input"> </form>
jquery
$('#myform').on('submit', function(){ $('#hidden_input').val($('#changestatus1').attr('class')); });
then on backend, can class of posted input (php example)
$classname = $_post['hidden_input']; switch($classname){ // stuff... }
php html drop-down-menu
No comments:
Post a Comment