<form id="check" action="." method="POST">
<input id="act" type="hidden" name="action"/>
<select id="blk">
<option value="blk">Bulk Actions</option>
<option value="tes">Active</option>
<option>Inactive</option>
<option>Delete</option>
</select>
<input type="submit" value="Submit" onclick="document.getElementById('act').value = 'document.getElementById('blk').selectedIndex.value'"/>
</form>
i want get the value by select tag and the value action will be change on input with name action as the value
You’ve mixed two concepts.
selectelement has avalueproperty that reflects the current selectionselectelement has a list of options with values and aselectedIndexproperty that reflects the position of the current selection. Use it like this:However, what you actually seem to want is
You forgot the
nameof yourselectcontrol, so no value would be posted. With it, you neither need a hidden input nor a click listener on the button (which should have been aonsubmitlistener on the form as well).