function check_val(val) {
alert(val);
return val;
}
this is my javascript function i take the value of val
<select name='select' id='select' onchange='check_val(this.value)'>
<option value='0'><------select------></option>
<option value='4'>apple</option>
<option value='5'>mango</option>
<option value='6'>berry</option>
</select> <?php <input type=hidden name='select' value=???> //by using javascript i need the value
this is my select tag now i want to put the values inside a hidden field and post this value to the next page
It doesnât work like that. When you submit the form, the value of that hidden input will be accessible in PHP with $_POST['select'] or $_GET['select'], depending on the submit method.