beanymanuk Posted July 6, 2012 Share Posted July 6, 2012 I can't disable the dropdown obviously So how do I stop users from being able to edit the dropdown but post the value. <select id="prizetype" name="prizetype" onchange="showDivs('div',this)" /> <option name="div1" value="regular" <?php if($prizetype=="regular") {?>selected="selected"<?}?>>Regular</option> <option name="div2" value="voucher" <?php if($prizetype=="voucher") {?>selected="selected"<?}?>>Voucher</option> <option name="div3" value="affiliate_link" <?php if($prizetype=="affiliate") {?>selected="selected"<?}?>>Affiliate link</option> <option name="div4" value="points" <?php if($prizetype=="points") {?>selected="selected"<?}?>>Points</option> </select> Link to comment https://forums.phpfreaks.com/topic/265322-disable-dropdown-but-allow-value-to-be-posted/ Share on other sites More sharing options...
Pikachu2000 Posted July 6, 2012 Share Posted July 6, 2012 if( !empty($_POST['prizetype']) ) and it matches one of the possible values, disable the select field and pass the value in a $_SESSION variable. Link to comment https://forums.phpfreaks.com/topic/265322-disable-dropdown-but-allow-value-to-be-posted/#findComment-1359696 Share on other sites More sharing options...
hakimserwa Posted July 10, 2012 Share Posted July 10, 2012 what exactly do you want to achieve here? Link to comment https://forums.phpfreaks.com/topic/265322-disable-dropdown-but-allow-value-to-be-posted/#findComment-1360487 Share on other sites More sharing options...
mikhl Posted July 17, 2012 Share Posted July 17, 2012 Have you thought of setting its visibility to none so it wouldn't show but would still be there to be submitted. You could modify this with a simple JS function. Link to comment https://forums.phpfreaks.com/topic/265322-disable-dropdown-but-allow-value-to-be-posted/#findComment-1362244 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.