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.

JS with Contact Form...

Featured Replies

Hi,

 

 

I already developed have the form which is working fine, and I have one dropdown menu, but what I want to do next is when one option is selected from the dropdown menu, another dropdown menu will appear below which is connected to the option selected from the first dropdown.

 

For example, if the user selects 'search engine' another dropdown menu will appear below with options to choose which search engine.

 

I've read that using JS 'onselect' might do the trick.

 

Anyone have any tutorials or examples I can look at?

 

Thanks.

You can add the additional dropdown menus to the form but hide them with "display: none". Then using jQuery you can show the relevant dropdown menu based on what the user selects from the first dropdown menu.

 

 

<select id="some-menu">
  <option value="search engine">Search engine</option>
  <option value="something else">Something else</option>
</select>

<select id="search-engine-menu" style="display:none">
  <option value="google">Google</option>
  <option value="yahoo">Yahoo</option>
  <option value="bing">Bing</option>
</select>

<select id="something-else-menu" style="display:none">
  <option value="first item">First item</option>
  <option value="second item">Second item</option>
</select>

Then add the JavaScript:

 

 

$('#some-menu').on('change',function(e) {
   if($(this).val() == 'search engine') $('#search-engine-menu').show();   
  else $('#search-engine-menu').hide();
   if($(this).val() == 'something else') $('#something-else-menu').show();
  else $('#something-else-menu').hide();
});
 

 

 

 

For this to work you'll need to load the jquery library in your page (http://jquery.com/).

Edited by djitsz

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.