I can check/uncheck radio buttons via JS but they don't "look" checked ***SOLVED***

This section is for posting questions which are not directly related to WYSIWYG Web Builder.
Examples of off topics: web server configuration, hosting, programming related questions, third party scripts.

Note that these questions will generally not be answered by the administrators of this forum.
Post Reply
Astro
 
 
Posts: 61
Joined: Mon Jul 07, 2014 6:38 pm

I can check/uncheck radio buttons via JS but they don't "look" checked ***SOLVED***

Post by Astro »

I hope this is a good place in the forum to post this question....

I have created a set of 6 radio buttons that trigger an event to load specific tables. I have the buttons spread into 3 different tabs.
I have created events that should select a particular radio button when moving between tabs (as the default for that tab).
Everything is functioning fine but the JS buttons selected by my code do not "appear" checked/unchecked properly.

To clarify, my JS code is "functionally" checking and unchecking my radio buttons but they do not "appear" that way.
When switching tabs, the first button should always be checked. Functionally it is but visually it's not.

I believe it has something to do with "class" of the checked/unchecked state but I have no idea on how to manipulate that using JS or jQuery.

Can someone help me with this or at least point me in the right direction?

Here is the page I'm working on showing the buttons and tabs...
https://publicmissiles.com/PartsTest1.aspx

Again, when switching tabs, the first button should always be checked. Functionally it is but visually it's not. Please help.

---Frank
Last edited by Astro on Sat Mar 24, 2018 9:22 pm, edited 1 time in total.
User avatar
Pablo
 
Posts: 21570
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: I can check/uncheck radio buttons via JS but they don't "look" checked

Post by Pablo »

Astro
 
 
Posts: 61
Joined: Mon Jul 07, 2014 6:38 pm

Re: I can check/uncheck radio buttons via JS but they don't "look" checked

Post by Astro »

Pablo wrote: Sat Mar 24, 2018 6:05 pm Maybe this is helpful?
https://www.wysiwygwebbuilder.com/forum ... 10&t=37833
Pablo,
I tried it and it made no difference. Here is the code:

Code: Select all

function TabSwitch2() {
   
    $("#CTbutton").prop("checked", true);     //I tried it here too.
    StripTableAF();doPTFGPT();return true;
    }
User avatar
Pablo
 
Posts: 21570
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: I can check/uncheck radio buttons via JS but they don't "look" checked

Post by Pablo »

Ok, in that case I do not know either.
Note that I cannot give support on custom code.
Astro
 
 
Posts: 61
Joined: Mon Jul 07, 2014 6:38 pm

Re: I can check/uncheck radio buttons via JS but they don't "look" checked

Post by Astro »

Pablo wrote: Sat Mar 24, 2018 6:29 pm Ok, in that case I do not know either.
Note that I cannot give support on custom code.
Yes, I understand you can't help with custom code. I'm hoping someone else here may have worked through this issue.

Do you think this is a good question for a jQuery forum, a CSS forum, or a general html forum?

Thanks again!
---Frank
User avatar
Pablo
 
Posts: 21570
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: I can check/uncheck radio buttons via JS but they don't "look" checked

Post by Pablo »

I noticed you are using jQuery Button as checkboxes, so maybe you will need to refresh them after changing the value?
http://api.jqueryui.com/checkboxradio/#method-refresh
Astro
 
 
Posts: 61
Joined: Mon Jul 07, 2014 6:38 pm

Re: I can check/uncheck radio buttons via JS but they don't "look" checked

Post by Astro »

Pablo wrote: Sat Mar 24, 2018 7:07 pm I noticed you are using jQuery Button as checkboxes, so maybe you will need to refresh them after changing the value?
http://api.jqueryui.com/checkboxradio/#method-refresh
Pablo,
That was it!
Thank you VERY much. :)

See it work, if you want.....
https://publicmissiles.com/PartsTest1.aspx
Post Reply