- Home /
How do I JavaScript to check if toggle is true?
On my GUI I have a toggle group with 6 different toggles (only 1 can be selected in the group). I also have an input element where user's must type in their name. Finally I have a submit button that user's press after they have selected a toggle (clear skies is selected by default) and entered their name. The toggle's names are:
Clear Skies
Rain Showers
Snow Storm
Windy Day
Violent Tornado
Superstorm
The name input element is called 'Name Field' The submit button's name is 'Go Button'
What would the JavaScript look like so that when the user clicks the button it loads the scene associated with the toggle choice and stores the user's name in a variable? (Also if you can, tell me how to disable the 'Go Button' until the user has selected a toggle and entered something into the input.)
Please help, need JS code I can work with. Less that a week to get this part done!
I'm looking for a similar solution to this but in C#. The documentation is a little lacking with regards to mixing code and the Unity editor.
Your answer

Follow this Question
Related Questions
Pause Menu Issue (Black Screen) 0 Answers
[4.6] Toggle/Checkbox On/Off 1 Answer
How can I reference a Toggle? 3 Answers
OnTriggerStay Not Working, JavaScript Help Needed 1 Answer
TextField text component not updating 2 Answers