• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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,
 
No more fooling around. Read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic