bagnallc Posted September 21, 2006 Share Posted September 21, 2006 hi thereat the moment i currently have a lot of forms which dependent on the users selection take you to a different page on my website (carrying forward some variables as they go) Id like to place them all in one dropdown with one go button. Is this possible?thanks Quote Link to comment Share on other sites More sharing options...
Barand Posted September 21, 2006 Share Posted September 21, 2006 You could put a menu of form names in a dropdown, then, when the user selects a particular form, display that form for the user to complete.Is that what you mean? Quote Link to comment Share on other sites More sharing options...
bagnallc Posted September 21, 2006 Author Share Posted September 21, 2006 hi thanks for reply.i will show some code and maybe that will helpthe following forms are among those currently on the page. as you will see each has its own go button and only displays depending on whether a variable is setbasically i would like to get these into a dropdown with one go button which then takes you to the relevant page.//include the UK/IRE option if not set or the unset option if it isif(isset($countryid)) { ?><form name="unsetcountryform" action="wizardunset.php" method="get"><input type="hidden" name="unsetcountry" value="<?php echo $countryid ?>"><?php include("hidden_fields_for_separate_forms.php"); ?><input type="submit" value="UNSET"> </form><?php } else { ?><form name="gotocountryform" action="country_form.php" method="get"><?php include("hidden_fields_for_separate_forms.php"); ?><input type="submit" value="SET"> </form><?php } //end of uk/ire set/unset options start of QSecho "</td><td width=8%>";if(isset($countryid)) { echo "Information already Set"; } else { ?><form name="gotoQScountryform" action="quicksetcountry.php" method="get"><?php include("hidden_fields_for_separate_forms.php"); ?><input type="submit" value="QS"> </form><?php } Quote Link to comment Share on other sites More sharing options...
Barand Posted September 21, 2006 Share Posted September 21, 2006 As I said, the only way I can think of is something like this[code]<html><head><meta name="generator" content="PhpED Version 4.5 (Build 4513)"><title>Multi form sample</title><meta name="author" content="Barand"><SCRIPT language='javascript'> var currentFormID = ''; function showHideForm (formid) { if (currentFormID != '') { var theForm = document.getElementById(currentFormID); theForm.style.visibility = 'Hidden'; } if (formid != '') { theForm = document.getElementById(formid); theForm.style.visibility = 'Visible'; } currentFormID = formid; }</SCRIPT><STYLE content='text/css'>DIV.form { width: 500px; border: 1px solid gray; visibility: hidden; position: absolute; top: 100; left: 0;}#unsetcountryform { background-color: #D9FFFF;}#gotocountryform { background-color: #ECE4B9;}#gotoQScountryform { background-color: #FFFFC0;}</STYLE></head><body><select name="formid" onchange="showHideForm(this.value);"> <option value="">- choose form -</option> <option value="unsetcountryform">Unset Country</option> <option value="gotocountryform">Set Country</option> <option value="gotoQScountryform">Go To QS Country</option></select><HR/><DIV> <DIV class='form' id="unsetcountryform"> <form name="unsetcountryform" action="wizardunset.php" method="get"> <input type="hidden" name="unsetcountry" value="<?php echo $countryid ?>"> <?php include("hidden_fields_for_separate_forms.php"); ?> <input type="submit" value="UNSET"> </form> </DIV> <DIV class='form' id="gotocountryform"> <form name="gotocountryform" action="country_form.php" method="get"> <?php include("hidden_fields_for_separate_forms.php"); ?> <input type="submit" value="SET"> </form> </DIV> <DIV class='form' id="gotoQScountryform"> <?php //end of uk/ire set/unset options start of QS echo "</td><td width=8%>"; if(isset($countryid)) { echo "Information already Set"; } else { ?> <form name="gotoQScountryform" action="quicksetcountry.php" method="get"> <?php include("hidden_fields_for_separate_forms.php"); ?> <input type="submit" value="QS"> </form> <?php } ?> </DIV></DIV></body></html> [/code] Quote Link to comment Share on other sites More sharing options...
bagnallc Posted September 21, 2006 Author Share Posted September 21, 2006 that is extremely helpful and very good of you to take the time.i will give it a go now.many thanks Quote Link to comment 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.