You need to sign in to do that
Don't have an account?

input radio checked problems/bug? Is there a workaround?
Setting the checked attribute in a dynamic way doesn't seem possible.
As per html spec, checked="checked", checked = "junk", checked="" all lead to a checked radio button. Just the presence of attribute is enough.
So it leads to following problems. I guess the workaround would be in Javascript?
//sfdc is smart enought to removes checked attribute in the rendered html because it is empty
<input type="radio" name="r1" value="Bike" checked="" />
//SFDC renders checked="" in html, hence button is checked. SFDC should get rid attribute as it does above
<input type="radio" name="r1" value="Bike" checked="{IF(false,'checked' ,'')}" />
//So try to get rid of the attribute itself dynamically. However SFDC does not allow the next two syntax in API 19.0 with complile time error - Element type "input" should be followed by either attribute specifications, ">" or "/>". Seems like it wants attribute=value syntax. It allows it at compile time in 16.0, but end users get the same message at run time, which is not acceptable.
<input type="radio" name="r1" value="Bike" {!IF(false,'checked' ,'')} />
<input type="radio" name="r1" value="Bike" {!IF(false,'checked=\"checked\"','')} />
outputpanel did work.
Thanks
All Answers
Hello,
I can think of two possible options.
Regards,
Mark
Mark,
#2 might work. Let me try it.
#1 does not work because my radio buttons are in a table grid.
Thanks
outputpanel did work.
Thanks
Would you mind marking my post as the solution?
Thanks,
Mark
Preferred_Contact_Type__c is a text field
Phone_Type_1__c
Phone_Type_2__c
Phone_Type_3__c
these all r pick list fields with value work , home ,fax
and user enters value in Preferred_Contact_Type__c
which if matched should select desired radio button
in this only the last radio button is selected
i want it to be preselected based on condition
i tried it, i m getting this error at the start of this line
error :Element type "input" must be followed by either attribute specifications, ">" or "/>"
<input type="radio" name="optionsRadios" id="" value="option1" {!IF((account.Phone_Type_1__c==account.Preferred_Contact_Type__c),'checked="checked"', '')}/>
something is wrong in this
``` ```