Re: How do i get the id value dynamically in java script?
Philip Luppens <[email protected]>
| Newsgroups | gmane.comp.java.open-symphony.webwork |
|---|---|
| Message-ID | <26142834.1150292206531.JavaMail.os-j2ee@opensymphony01.managed.contegix.com> |
> I have a html table in which is dynamically shown
> through iterator. In each row of that table i have a
> date picker with corresponding text field. On click
> of the date picker i need to pass the id value of the
> corressponding text box to javascript.
>
> in <ww:textfield> if we does'nt specify the id
> attribute.. webworks automatically creates the id
> value... is it possible to capture the dynamically
> created id and pass it to my javascript... or is it
> possible to create dynamic id of ourself??
I don't get your question, but yes, you can always make dynamic ids yourself, just declare them in your tag like this: id="item_id_%{id}" for webwork. I believe you can use this.id in javascript to get the id of the current tag in your js function call (eg. onclick="foo(this.id);"), but I'm no js fan so I might be wrong.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=34288&messageID=66729#66729
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]