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.

Checkboxes

Featured Replies

Hey everyone.

 

Does anyone know how you can uses checkboxes while making sure that the user can only select one checkbox and not multiple checkboxes. I know that this is achievable with radio buttons but my clients is adamant that they want to have checkboxes.

 

Thanks for any help

You can use document.getElementsByName('checkboxName') to get all the checkboxes. You can then write a function that unselect each of them except a predefined one, which you can identify using the "this" keyword (unless you're not assigning handlers, but adding event listeners, in which case you'll have to get the window event and use that to identify the target in standards-based browsers and the srcElement in IE), assign a function to each of the checkboxes that passes a reference to itself (if it can) and hope that no-one ever tries using that page without JavaScript enabled and that page performance isn't an issue.

 

Or you call tell your client that he's being an idiot and should just accept that radio buttons are the solution.

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.