Login  Register

Adding unique IDs in xforms with JS

Posted by Stephanie Hall (TT) on Oct 26, 2009; 8:22pm
URL: https://discuss.orbeon.com/Adding-unique-IDs-in-xforms-with-JS-tp277068.html

Hi,

 

I am new to Orbeon and X-Forms, and in my application, I am trying to use javascript with my xforms to show/hide buttons for different instances in the repeats by putting them in divs.  Is there a way to assign a unique ID to the div specific to the index of the repeater?   They can’t be hard-coded.

 

So to loosely illustrate:

 

                <xforms:repeat id=”repeater”>

                                <my instance #1>

                                <my instance #2>

                                <my instance #3>

                                                <button onclick=”showDiv(“div_3”)”>

                                                <div id=”div_3”>…</div>

                </xforms:repeat>

 

I’ve tried to do something like ‘<div id="advancedSettings_<xforms:output value="count(preceding-sibling::component)+1"/>” style="display:none">’ but that doesn’t work.

 

Any help is greatly appreciated. Thanks!

Stephanie



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws