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

command line - Use qwinsta in PowerShell ISE -

java - Incorrect order of records in M-M relationship in hibernate -

Python website log in: BIG-IP can not find session information in the request -