chandu wrote: > Hi David, > > Thank you very much. We got it to work but with a different approach. > > I've done all the changes suggested by you and at the first glance it > looked like it worked fine but when I added one more (3rd) radio > button it always checked the 3rd one and when I added one more radio > button it always checked the 4th one. So, it always checked the last > one, reason being the word 'checked' appears in the <input /> tag. It > looks like whenever the attribute 'checked' appears, irrespective of > it's value the radio button will be checked and in our case since all > the radio buttons in the group have 'checked' attribute the last one > is getting selected. > > So, keeping this in mind I've changed the radio buttons code to the > following to make it work. > > <div ex:content="if(contains(.type, 'State'),'<input type=\'radio\' > name=\'radiogroup\' checked=\'checked\'>','<input type=\'radio\' name= > \'radiogroup\'>')"></div>State > > <div ex:content="if(contains(.type, 'Country'),'<input type=\'radio\' > name=\'radiogroup\' checked=\'checked\'>','<input type=\'radio\' name= > \'radiogroup\'>')"></div>Country > > <div ex:content="if(contains(.type, 'City'),'<input type=\'radio\' > name=\'radiogroup\' checked=\'checked\'>','<input type=\'radio\' name= > \'radiogroup\'>')"></div>City > > Logic is the same but instead of using the function 'contains()' > inside the <input> used it in the ex:content of a div to populate the > whole <input> in a needed fashion with 'checked' attribute only for > the needed radio button. > I'm actually surprised that that works :-)
> Everything looks good with this approach till now. > > Can we fine tune this approach or is it okay to use as it is? > I think if it works then you can just use it. It looks a bit hard to read but oh well. In the future we can try to handle <input> specially. David --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/simile-widgets?hl=en -~----------~----~----~----~------~----~------~--~---
