NLCJ Posted February 15, 2010 Share Posted February 15, 2010 Hello, I'm creating a form which depends on their first input, when they select the first type from a dropdownlist and press 'Go to step 2' they'll go there and select a subtype (which depends on their first input). Above the input of subtype I've created the dropdownlist from step 1, so they'll be able to see what they've chosen. The problem is hard to explain, but I'll try. <?php $page = $_GET['p']; $gotchatype = $_POST['gotchatype']; $gotchasubtype = $_POST['gotchasubtype']; if($page == gotcha){ if($gotchatype == movies) { if($gotchasubtype == rip){ <!-- Form of step 3 --!> } <!-- Form of step 2 --!> } <!-- Form of step 1 --!> } ?> But since I've 'DISABLED' the dropdown box that they've chosen earlier it doesn't send that part, so it doesn't go further than if($page == gotcha){. I hope that you understand my problem. Regards, EDIT: I've made the script more 'simple' to understand. Quote Link to comment https://forums.phpfreaks.com/topic/192190-form-with-a-lot-of-different-pages/ Share on other sites More sharing options...
Psycho Posted February 15, 2010 Share Posted February 15, 2010 Save the POSTed data to the session. Then when the page loads you can set the previously selected values using the SESSION data. Quote Link to comment https://forums.phpfreaks.com/topic/192190-form-with-a-lot-of-different-pages/#findComment-1012829 Share on other sites More sharing options...
NLCJ Posted February 16, 2010 Author Share Posted February 16, 2010 Thanks, I think I might be able to do that, but that would take a lot of time. Isn't it possible to send the information from a 'Disabled' dropdown-box? Like: <form method="POST" action="page.php"> <select name="gotcha-type" DISABLED> <option value="movies">Movies / Images</option> </select> </form> Right now it sends the information if I remove 'DISABLED' (of course, totally logic), but is it also possible to keep it sending while it is disabled? Regards, Quote Link to comment https://forums.phpfreaks.com/topic/192190-form-with-a-lot-of-different-pages/#findComment-1013015 Share on other sites More sharing options...
Thierry Posted February 16, 2010 Share Posted February 16, 2010 If you really need it to be sent with a form, rename the select field to 'gotcha-type fake' and add a hidden input field with the actual name 'gotcha-type' with value you need. Quote Link to comment https://forums.phpfreaks.com/topic/192190-form-with-a-lot-of-different-pages/#findComment-1013016 Share on other sites More sharing options...
Psycho Posted February 16, 2010 Share Posted February 16, 2010 Isn't it possible to send the information from a 'Disabled' dropdown-box? No, disable fields don't get passed because they are disabled. That's kind of the point of disabling them. Quote Link to comment https://forums.phpfreaks.com/topic/192190-form-with-a-lot-of-different-pages/#findComment-1013194 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.