struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shekhar Yadav" <sya...@strongmail.com>
Subject How to change "targets" attribute for submit button from java script?
Date Mon, 09 Apr 2007 18:53:46 GMT
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 !!

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message