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.

How do I switch between two forms (using radio buttons)?

Featured Replies

Hi.

 

So, the idea is, you've got two forms, each with a different PHP script and other properties (EG, character limit). Instead of having two taking up space and being inefficient, the user can toggle between them using one of two radio buttons.

 

I'd be very appreciative if someone would tell me how to do that.

 

Thanks, you knowledgeable chaps.

First thought (top of the head).. don't actually use radio buttons.. I'd use an image that looked like one instead. If you did this in conjunction with ajax or similar, you wouldn't have to have the page reload or anything either.

 

::edit::

Just thought, you could probably use the button images to toggle a div's visibility so that the new div appears on top of the old one, and the new div would have the new form in it

I've just made a search form for a property website that you can toggle between searching for lettings and searching for sales. Basically two forms, one of them hidden. You toggle between them via a link and the 'hidden' one slides into view utilising mootools scroll method. No page refresh and seems to work quite well.

Can't show you a link yet as the site isn't live but I'll try and dig out the code for you tomorrow if I get the chance.

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.