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
Post a Comment