Page 1 of 1
Setting initial state with events or conditions
Posted: Tue Jun 23, 2020 9:18 pm
by equalizer1001
Hello... I am using a 2 tab object with a checkbox and seven radio buttons on each tab. I need the first radio button to be selected (initial state: selected) and the checkboxes initial state as: Not selected when moving back from a previously selected tab. I don't see an 'events' or 'conditions' to set the initial state of either of these in the tabs object or checkbox. Thanks in advance for any help someone may give or direction anyone can steer me in.
Re: Setting initial state with events or conditions
Posted: Wed Jun 24, 2020 1:36 am
by lac8383
Hello
I not 100% certain on what you want your result to be and if you plan some sort of event based on a certain selection. You mentioned that you want to have 2 tabs each with a checkbox and 7 radio buttons.
The checkbox for each tab would be unchecked by default for both tabs. The first radio button would be checked for both tabs. When you switch back and forth between tabs, the first radio button in each tab would show as checked. Is that correct?
If so, you would double click each radio button for tab 1 and give the same name (e.g. radio1) in the Group name field. You would do the same for the radio buttons for tab 2 with the same name (radio2) in the Group name field.
This way when you preview them in a browser, the first radio button in tab 1 and tab 2 would both be enabled when switching between tabs. When clicking on other radio buttons in the same tab, that radio button when clicked will be enabled and the previous radio button would not.
What other functions are you intending to do based on buttons or check boxes being enabled assuming what I described is what you are looking for?
Re: Setting initial state with events or conditions
Posted: Wed Jun 24, 2020 5:55 am
by Pablo
A checkboxes is a standalone elements A selected checkbox does not affect the state of other checkboxes.
Radio buttons should be used in groups (all with the same groupname). A selected radio button will automatically uncheck the other radio buttons in the same group.
Re: Setting initial state with events or conditions
Posted: Wed Jun 24, 2020 1:12 pm
by equalizer1001
I have each set of radio buttons, on each tab, set with a unique name. In addition, the ‘Value’ property is numbered (for each button) in ascending order 01-07 for each set. There is a small gray round image above each radio button which is there to prohibiting their use until the checkbox is checked. Once checked, the small gray round images on that tab are all hidden allowing the use of the buttons. The first button is initially set to show as selected when the checkbox is first checked. Each radio button has a corresponding object that appears underneath (not inside) the Tabs object when that button is selected. The button’s onclick event is set to show its corresponding object and hide all other objects that would appear in the same spot if another button was selected previously. What needs to occur is, when moving back to a previously selected tab, the checkbox’s initial state needs to be ‘not checked’ because I cover the radio buttons (in the tab’s activate event) with the small gray round images prohibiting the radio buttons use until the checkbox is check. If the checkbox was never checked, before moving to the other tab, all works fine when coming back to it. The problem is, when a checkbox is checked, and a button (other than the first one) is selected, it stays selected and if you move back from the other tab (hiding all buttons with the gray images) there is no way to set the first button as selected or set the checkbox’s initial state as not checked which I’d like to do as an ‘action’ in the Tab’s ‘activate event’ for that tab. Is there any way to add an event action of ‘set initial state’ for the checkbox and radio button to be accessed in the events of another object? This would be an ideal solution to my dilemma.
Re: Setting initial state with events or conditions
Posted: Wed Jun 24, 2020 1:41 pm
by Pablo
What you are trying to do cannot be done with standard functionality. This requires a custom script.
Re: Setting initial state with events or conditions
Posted: Wed Jun 24, 2020 11:59 pm
by equalizer1001
Alright thanks Pablo. Would I be correct to assume these attributes could be set with a javascript which I would run out of the Tabs Events area with a 'run javascript' action? Sorry for my ignorance, I've written small javascripts and am anxious to resolve this issue. Any hints / links would be greatly appreciated. Thanks…
Re: Setting initial state with events or conditions
Posted: Thu Jun 25, 2020 6:16 am
by Pablo
I would run out of the Tabs Events area with a 'run javascript' action?
Correct
The script itself should be placed between the head tags. Then you can trigger the function via 'Run JavaScript'
Re: Setting initial state with events or conditions
Posted: Thu Jun 25, 2020 12:11 pm
by equalizer1001
Thank you very much Pablo. I appreciate it...