Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Show/hide radio buttons based on checkbox state
Message
From
28/01/2014 12:04:58
 
 
To
28/01/2014 11:16:38
General information
Forum:
Javascript
Category:
JQueryUI
Miscellaneous
Thread ID:
01592468
Message ID:
01592491
Views:
38
>>>Well, I've got the radio buttons initially hidden with
>>>
>>>
>>>       div id = "YSElig<<ch>>" style="display:none">
>>>         input type="radio" name="py_SpElig_Type<<ch>>" value="SP" <<iif(lnPY_EligType=1,"checked","")>>/><b>AHYS SUB+Spouse</b>
>>>         input type="radio" name="py_SpElig_Type<<ch>>" value="SUB" <<iif(lnPY_EligType=2,"checked","")>>/><b>AHYS SUB Only</b>
>>>       div>
>>>
>>>
>>>based off of what I've been reading on jQuery.
>>>
>>>Unfortunately, checking the box doesn't Show the radiobuttons.
>>>
>>>>What exactly is the issue?
>>>>
>>>>
>>>>>Hi Gang
>>>>>
>>>>>Let's pretend that I know very very little about jQuery, so please use small words.
>>>>>
>>>>>I'm trying to hide/show radiobuttons based off the state of a checkbox and this code is part of a TextMerge VFP section
>>>>>
>>>>>
>>>>>
>>>>>                   script type="text/JavaScript" Language = "JavaScript">
>>>>>                           $('#AHYSChk01').click(function()
>>>>>                           {
>>>>>                              if ($'#AHYSChk01').is(:checked))
>>>>>                               { $('#YSElig01').show(); 
>>>>>                                } 
>>>>>                              else
>>>>>                               { $('#YSElig01').hide(); 
>>>>>                                }
>>>>>                           }
>>>>>                         
>>>>>                      /script>	
>>>>>
>>>>>where AHYSChknn is the div id for the radiobuttons and AHYSChknn is the checkbox id
>>>>>
>>>>>I would have included the entire chunk of code, except we can't inline HTML, afaik
>>>>>
>>>>>Thanks
>>>>>
>>>>>What am I missing?
>>
>>Probably the fact the :ischecked should be in quotes:
if ($'#AHYSChk01').is(':checked'))
>
>Apparently, it's not recognizing the 'onclick' routine.

So what's the html for the element with the 'AHYSChk01' Id ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform