html - Hidden variable not passing when select box is disabled in php -


i have 2 pages lets first.php, second.php.

first.php:

<form name=register method="post" action="second.php"> name:<input type="text" name="username" value=<?=$username?> > email:<input type="email" name="email" value=<?=$email?> > hobbies:<select name="hobbies" id="hobbies" disabled> <option value="cricket">cricket</option> <option value="football">football</option> </select> </form> 

second.php:

<? print_r($_post); 

i getting name , email , not select value.

if print post value not getting select value, when removing disabled in select, getting select value in hidden.

in scenario, don't want user select select box , when submit form, should value in hidden in second.php.

i have tried many possible ways, no avail. can suggest me how can achieve this.

disabled tags can't send post. change disabled readonly or hidden


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -