• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Putting in a variable as an object name?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Trying to put in a number of radioboxes onto a page. I have a loop where 3 radioboxes are displayed each time, each time with the same name so only one can be chosen in each occasion of the loop.
Basically I want this,
<input type="radio" name="radiobox[$variable]"/>
if I used javascript or anything else, I would set the name = radiobox[i] where 'i' would change for each loop. But can't get the variable into the name field here.
Anyone able to help?
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Evan,
You can either use the combinaison of <xsl:element> and <xsl:attribute> to achieve this. In <xsl:attribute>, you can use <xsl:value-of select="$variable"/> to output the value of your variable. Or use:
<input type="radio" name="radiobox[{$variable}]"/>
Cheers,
 
reply
    Bookmark Topic Watch Topic
  • New Topic