Hello, I need to submit a form from all the tab clicks . For that What I have done is by changing the tabs.js file in the following way function decorateMenu(menu) { var items = menu.getElementsByTagName("li"); for (var i=0; i < items.length; i++) { items[i].firstChild.myIndex = i; // retain any existing onclick handlers from menu-config.xml xAddEvent(items[i].firstChild, 'click', formSumit); setCookie("menuSelected", this.myIndex); } activateMenu(items); }
function xAddEvent(element, event, fn){ //identify supported method of adding encapsulated event listeners var etype = (typeof document.addEventListener != 'undefined') ? 'addEventListener' : (typeof document.attachEvent != 'undefined') ? 'attachEvent' : 'none'; //if encapsulated event listening is not supported, don't continue if(etype == 'none') { return; } //set event name prefix eprefix = (etype == 'attachEvent' ? 'on' : ''); element[etype](eprefix + event, fn, false); } function formSumit(){ alert('going to submit form'); document.formTest.submit(); return false; } Here i have added an addevent method for adding a "formSubmit" method One of the drawback with this approach is that I have hardcoded the name of the HTML form in this script. I was not able to parameterize the form name when called from the menu-config/jsp I would like to know wheather there is any better approach compared to this ? -- View this message in context: http://www.nabble.com/tabbed-menu-form-submit-tp23601821p23601821.html Sent from the struts-menu-user mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ struts-menu-user mailing list struts-menu-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/struts-menu-user