• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Putting in a variable as an object name?

 
Ivan Egan
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • 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,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic