Thanks, using targetsArray works.

I was not sure if it safe and future safe, so I was bit hesitant in
using targetsArray.

Regards,
Shekhar

-----Original Message-----
From: Musachy Barroso [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 09, 2007 3:25 PM
To: Struts Users Mailing List
Subject: Re: How to change "targets" attribute for submit button from
java script?

The widget for the submit button will have a "targets" string field, but
you
want to change the "targetsArray" field, given:

<s:submit theme="ajax" id="mybutton" ...>

you can do this:

var widget = dojo.widget.byId("mybutton");
widget.targetsArray = ["id1", "id2"];

regards
musachy

On 4/9/07, Shekhar Yadav <[EMAIL PROTECTED]> wrote:
>
> I have been trying to do this:
>
>
>
> function submitNext() {
>
>     var tabId = $("nextPage").value;
>
>     submit_next = document.getElementById(tabId);
>
>     var cells = submit_next.getElementsByTagName("input");
>
>     for (var i = 0; i < cells.length; i++) {
>
>     id = cells[i].id;
>
>         if ( id == "submit_next") {
>
>             cells[i].targets = tabId;
>
>             alert(cells[i].targets);
>
>             cells[i].click();
>
>         }
>
>     }
>
> }
>
>
>
> The attempt to set targets in the above function does not work. In
alert
> it does display the changed targets value, but the click seems to not
> find it.
>
>
>
> The reason I am trying to do this is to create tabbed pages, where the
> content of the each tab has a submit button that should only update
its
> tab on clicking submit. Now, as the tabs have generated id from java
> script, I need to modify the targets attribute on the fly.
>
>
>
> I have been struggling with this for last 4-5 days; any help would be
> greatly appreciated.
>
>
>
> Thanks,
>
> Shekhar Yadav
>
>
>
> ---
>
> Tea, what else !!
>
>
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to