Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Drop down lists on separate pages working together

Featured Replies

Hi

 

I'm new and i'm not sure what the correct name for this is.

 

I have drop down lists on separate pages and want them linked to each other. i.e. the first list has options 1,2,3,4 if i select 1 and submit, it will take me to another page with a drop down list displaying 1's options, but if i select 2, it will take me to the same page but with the drop down list displaying 2's options, can some one help, i guess it's javascript which is why i have put the message in this section.

 

code i already have is:

 

PAGE_1.php

 

<html><head></head><body>

<form method="get" action="PAGE_2.php">

<select name="material">

<option value="Acrylic">Acrylic</option>

<option value="Block Mounted">Block Mounted</option>

<option value="Canvas">Canvas</option>

<option value="Clipped">Clipped</option>

<option value="Framed">Framed</option>

</select>

<input type="submit" value="next page" />

</form>

</body></html>

 

PAGE_2.php

 

<html><head></head><body>

<form method="get" action="PAGE_3.php?">

<input type="hidden" name="material" value="<?php echo $_GET['material']; ?>">

<select name="color">

<option value="blue">blue</option>

<option value="red">red</option>

<option value="yellow">yellow</option>

</select>

<input type="submit" value="next page" />

</form>

</body></html>

 

PAGE_3.php

 

<html><head></head><body>

<?php

echo "material = " . $_GET['material'];

echo "<br /><br />color = " . $_GET['color'];

?>

</body></html>

The nearest I can suggest is chained select boxes (javascript) where a choice in the first box changes the choices in the second select box and a choice there changes the selection in a third.

http://www.dynamicdrive.com/dynamicindex16/chainedselects/index.htm

 

or the chained select menu

http://www.dynamicdrive.com/dynamicindex1/chainedmenu/index.htm

If you have the checkboxes on multiple pages it'd prob be best to write something server side for that:

 

Maybe:

if ($_POST['material'] == 'Acrylic') {
  echo 'check box based on arcylic';
} 
elseif ($_POST['material'] == 'Block Mounted') {
  echo 'check box based on block mounted';
} 

etc. etc.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.