I am using Twitter Bootstrap’s Javascript radio toggle buttons and want to get form input based on the state of the toggle.
The simplest approach I could find is to add an invisible tag within the buttons — here’s the helpful jsFiddle example that someone threw up.
It works nicely, but it’s still sort of a kludge. My question is: what’s the clean way to get form input from these buttons, i.e. without the extra hidden radio inputs?
How about
DEMO
I think I misread your question the first time… You can create a hidden form element (you need it to access the value when you submit the form unless you do AJAX) and use JS to set its value.
HTML
JS
DEMO