I am using the following code to show or hide a table depending on the checkbox is selected or not..
<body onload="document.f.firstfield.focus(),showOnLoad();">
My Javascript is:
function showOnLoad(){
if((document.getElementById('chk').checked)){
document.getElementById('div1').style.display = "block";}else{
document.getElementById('div1').style.display = "none";}
}
Its working fine till this. But, now I wanted to use another function showSomething() which does the same functionality as above but for different checkbox and different table.
when I change my code line to this:
<body onload="document.f.firstfield.focus(),showSomething(),showOnLoad();">
both functions are not working. How can I make them both work together? Any help is appreciated!
showSomething()?