I am trying to control a web page that has an expansion box named "signContac t", clicking on this expansion box unhides additional form details.
I want to achieve the same as clicking on this box from my VB script
Below is the section of Java script behind the webpage I am working with - i.e. the expansion box (plus.gif) and the method I wish to activate - "toggleDiv(spCo ntact)"
<tr>
<td width="9" class="SubSectH eading"><img src="/images/plus.gif" name="signConta ct" WIDTH="9" HEIGHT="9" ALT="Show/Hide Road Authority/Utility Contact Details" onClick="toggle Div(spContact); toggleSign('sig nContact');"></td>
<td class="SubSectH eading"> R oad Authority/Utility Contact</td>
</tr>
I tried the following VB code with out any luck
Set objCB = docIE.getElemen tById("signCont act")
objCB.onclick = "toggleDiv(spCo ntact)"
The above doesn't error out but objCB is always empty after code is run. Do I have to declare Internet Explorer as an object and then use VB to send the above onclick = toggleDiv(spCon tact) method to Internet Explorer? Can you offer any other suggestions.
There is a second expansion box
<tr>
<td width="9" class="SubSectH eadingRed"><img src="/images/plus.gif" name="signAuInf o" WIDTH="9" HEIGHT="9" ALT="Show/Hide Road Authority/Utility Information" onClick="toggle Div(spAuInfo);t oggleSign('sign AuInfo');setCoo kie('AuthInfoSe en-613355','026295 08X2');"></td>
<td class="SubSectH eadingRed">&nbs p;Road Authority/Utility Information
</tr>
I want to achieve the same as clicking on this box from my VB script
Below is the section of Java script behind the webpage I am working with - i.e. the expansion box (plus.gif) and the method I wish to activate - "toggleDiv(spCo ntact)"
<tr>
<td width="9" class="SubSectH eading"><img src="/images/plus.gif" name="signConta ct" WIDTH="9" HEIGHT="9" ALT="Show/Hide Road Authority/Utility Contact Details" onClick="toggle Div(spContact); toggleSign('sig nContact');"></td>
<td class="SubSectH eading"> R oad Authority/Utility Contact</td>
</tr>
I tried the following VB code with out any luck
Set objCB = docIE.getElemen tById("signCont act")
objCB.onclick = "toggleDiv(spCo ntact)"
The above doesn't error out but objCB is always empty after code is run. Do I have to declare Internet Explorer as an object and then use VB to send the above onclick = toggleDiv(spCon tact) method to Internet Explorer? Can you offer any other suggestions.
There is a second expansion box
<tr>
<td width="9" class="SubSectH eadingRed"><img src="/images/plus.gif" name="signAuInf o" WIDTH="9" HEIGHT="9" ALT="Show/Hide Road Authority/Utility Information" onClick="toggle Div(spAuInfo);t oggleSign('sign AuInfo');setCoo kie('AuthInfoSe en-613355','026295 08X2');"></td>
<td class="SubSectH eadingRed">&nbs p;Road Authority/Utility Information
</tr>