0

I've got a very large grid of buttons that a user will use to set their availability. Currently, the user must click each button one at a time, which works, but can get really repetitive.

I was hoping to create a grid of button-like objects where the user can select multiple buttons by holding down their mouse button and dragging.

Is there any sort of equivalent to a button in HTML, React or Bootstrap where the click does not need to be released?

If not, would anyone here have any sort of suggestion?

Thank you

Rudra
  • 21
  • 1

1 Answers1

0

<script language="JavaScript">
 function toggle(source) {
  checkboxes = document.getElementsByName('foo');
  for(var i=0, n=checkboxes.length;i<n;i++) {
    checkboxes[i].checked = source.checked;
  }
}
</script>

<input type="checkbox" onClick="toggle(this)" /> Toggle All<br/>

<input type="checkbox" name="foo" value="bar1"> Monday<br/>
<input type="checkbox" name="foo" value="bar2"> Tuesday<br/>
<input type="checkbox" name="foo" value="bar3"> Everyday<br/>
<input type="checkbox" name="foo" value="bar4"> Days that don't end in 'Y'<br/>

Source

Community
  • 1
  • 1
newcool
  • 319
  • 2
  • 20