Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Steven Lichtenberg on May 21, 2008 11:14
open dhtmlx forum
Getting form data from different tabs

Given an onSelectHandler that looks like this

function doClick(id){
a_tabbar.forceLoad(id);
//alert(id);
test = a_tabbar.getActiveTab();
alert(test);
switch(test){
case "a1":
frmnm=document.getElementById("carrierform");
break
case "a2":
frmnm=document.getElementById("bkcarfrm");
break
case "a3":
frmnm=document.getElementById("legalform");
break
}
alert(frmnm.name+"\n"+frmnm.Id+"\n"+frmnm.action);
     return true;
    } //doClick

I am trying to get the form from each of the tabs. I want to be able to set XMLHTTPRequest to the value of each form action so I can submit the form whenever someone tabs off of it.

I am getting undefined or null values for the getElementByID functions for any but the first tab (default). It appears that the HTML for each of the other forms is not loaded into the DOM . Any pointers?

Thanks
Answer posted by Support on May 22, 2008 03:17
In ajax-html mode content of tab loaded only after tab in question selected.
So, initially, only content of first tab available. When you selecting second tab, the content of second tab starts loading ( basically it not available yet, and will be available after some delay - when data will be loaded from server )

You can force loading of all tabs by using
    tabbar.forceLoad
against all tabs, after tabbar creation