Home
TeamSite
js onload function call
prudent
I have two tab One(English) and sec(Hindi)........... in cfg file.....
I have call window.onload function for english tab its working but I am trying window.onload function for Hindi tab its not working ......
how to call window.onload function for second Tab(Hindi)
Find more posts tagged with
Comments
vpatel
Onload function is not tab specific. It is executed whenever the form loads. You'll have to code accordingly.
prudent
Hi All,
As mentioned,
We have two tabs in our DCT.
One is English and the the other Hindi.
I am calling window.onload=test;
test function is as this.
test()
{
IWDatacapture.getItem("/medical/English/english/Doctors").setVisible(true);
IWDatacapture.getItem("/medical/English/english/Hospitals").setVisible(false);
IWDatacapture.getItem("/medical/English/english/premium_location").setVisible(false);
}
its working fine
but if I add these lines it is not working.
IWDatacapture.getItem("/medical/Hindi/hindi[1]/Doctors").setVisible(true);
alert("in 2");
IWDatacapture.getItem("/medical/Hindi/hindi[1]/Hospitals").setVisible(false);
alert("in 3");
IWDatacapture.getItem("/medical/Hindi/hindi[1]/premium_location").setVisible(false);
I am using
IWDatacapture.getItem("/medical/Hindi/hindi[1]/Doctors").setVisible(true);
in onitemchange,its working.
Why is it so that this is not working on window.onload.
Kindly suggest a way out for me or point something which I am doing wrong.
Thanks,
santosh013
Hi Prudent,
You just need to break your JS into two for the tabs.
Do like this
function() {
english_val();
hindi_val();
}
Place Your english tab JS codes in english_val function and hindi js codes in
hindi_val function.
call
window.onload=function;
Your work will be done.
I have checked at my end.
njoy!!!!