Jump to content
xisto Community
Sign in to follow this  
claireb85

Multiple Drop Down Lists ? Multiple drop down lists to take user to new page

Recommended Posts

Hi everyone

I was wondering if anyone could help.

I want to create a page with multiple drop down lists and depending what the user selects decides the page they will be taken to. Sorry i havent explained this too well.

Here is an example of what i want (link below) the user is also emailed a copy

http://forums.xisto.com/no_longer_exists/

I have searched the web and come close but nothing does it right

I would be extremely greatful if anyone could help!

Thanks

Share this post


Link to post
Share on other sites

He is a script which works with dates and pull-downs.If you have some php skill, you might be able to re-work it to generate the anchor tags for your site.

<?php # Script 3.12 - dateform.php (2nd version after Script 3.7)$page_title = 'Calendar Form';// This function makes three pull-down menus for the months, days, and years.function make_calendar_pulldowns($m = NULL, $d = NULL, $y = NULL) {	// Make the months array.	$months = array (1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');		// Make the months pull-down menu.	echo '<select name="month">';	foreach ($months as $key => $value) {		echo "<option value=\"$key\"";		if ($key == $m) { // Preselect.			echo ' selected="selected"';		}		echo ">$value</option>\n";	}	echo '</select>';		// Make the days pull-down menu.	echo '<select name="day">';	for ($day = 1; $day <= 31; $day++) {		echo "<option value=\"$day\"";		if ($day == $d) { // Preselect.			echo ' selected="selected"';		}		echo ">$day</option>\n";	}	echo '</select>';		// Make the years pull-down menu.	echo '<select name="year">';	for ($year = 2005; $year <= 2015; $year++) {		echo "<option value=\"$year\"";		if ($year == $y) { // Preselect.			echo ' selected="selected"';		}		echo ">$year</option>\n";	}	echo '</select>';} // End of the function definition.// Create the form tags.echo '<h1 id="mainhead">Select a Date:</h1><p><br /></p><form action="dateform.php" method="post">';// Get today's information and call the function.$dates = getdate();make_calendar_pulldowns ($dates['mon'], $dates['mday'], $dates['year']);echo '</form><p><br /></p>'; // End of form.// Print the current day and time.echo '<p>Today is ' . date ('l') . '. The current time is ' . date ('g:i a') . '.</p>';?>

I didn't write this script, but I can assist with modding it if you need some help. Post back here if required.

Share this post


Link to post
Share on other sites

Or if you don't want to go to the php route and want to stick with a CSS/html menu then go to http://www.cssplay.co.uk/menus/ since they got a nice list of multiple drop down menu's and of course other types of drop down menus;

Share this post


Link to post
Share on other sites

SM,check the referenced link in the opening post.They need input selects rather than a drop-down menu. Definately a php solution (or ASP).

Share this post


Link to post
Share on other sites

Hey jlhaslip thank u so much for your reply. I have a basic php knowledge but dont really understand what this code does what is supposed to happen when i select from the different drop downs. I would be really greatful if you could help me with this

Thanks again

He is a script which works with dates and pull-downs.If you have some php skill, you might be able to re-work it to generate the anchor tags for your site.

// This function makes three pull-down menus for the months, days, and years.
function make_calendar_pulldowns($m = NULL, $d = NULL, $y = NULL) {

// Make the months array.
$months = array (1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');

// Make the months pull-down menu.
echo '<select name="month">';
foreach ($months as $key => $value) {
echo "<option value=\"$key\"";
if ($key == $m) { // Preselect.
echo ' selected="selected"';
}
echo ">$value</option>\n";
}
echo '</select>';

// Make the days pull-down menu.
echo '<select name="day">';
for ($day = 1; $day <= 31; $day++) {
echo "<option value=\"$day\"";
if ($day == $d) { // Preselect.
echo ' selected="selected"';
}
echo ">$day</option>\n";
}
echo '</select>';

// Make the years pull-down menu.
echo '<select name="year">';
for ($year = 2005; $year <= 2015; $year++) {
echo "<option value=\"$year\"";
if ($year == $y) { // Preselect.
echo ' selected="selected"';
}
echo ">$year</option>\n";
}
echo '</select>';

} // End of the function definition.

// Create the form tags.
echo '<h1 id="mainhead">Select a Date linenums:0'><?php # Script 3.12 - dateform.php (2nd version after Script 3.7)$page_title = 'Calendar Form';// This function makes three pull-down menus for the months, days, and years.function make_calendar_pulldowns($m = NULL, $d = NULL, $y = NULL) { // Make the months array. $months = array (1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); // Make the months pull-down menu. echo '<select name="month">'; foreach ($months as $key => $value) { echo "<option value=\"$key\""; if ($key == $m) { // Preselect. echo ' selected="selected"'; } echo ">$value</option>\n"; } echo '</select>'; // Make the days pull-down menu. echo '<select name="day">'; for ($day = 1; $day <= 31; $day++) { echo "<option value=\"$day\""; if ($day == $d) { // Preselect. echo ' selected="selected"'; } echo ">$day</option>\n"; } echo '</select>'; // Make the years pull-down menu. echo '<select name="year">'; for ($year = 2005; $year <= 2015; $year++) { echo "<option value=\"$year\""; if ($year == $y) { // Preselect. echo ' selected="selected"'; } echo ">$year</option>\n"; } echo '</select>';} // End of the function definition.// Create the form tags.echo '<h1 id="mainhead">Select a Date:</h1><p><br /></p><form action="dateform.php" method="post">';// Get today's information and call the function.$dates = getdate();make_calendar_pulldowns ($dates['mon'], $dates['mday'], $dates['year']);echo '</form><p><br /></p>'; // End of form.// Print the current day and time.echo '<p>Today is ' . date ('l') . '. The current time is ' . date ('g:i a') . '.</p>';?>I didn't write this script, but I can assist with modding it if you need some help. Post back here if required.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.