Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

msaccess webbrowser control not processing jscript, why?

Status
Not open for further replies.

lamarw

MIS
Dec 18, 2002
223
US
Hi everybody,
I am using the msaccess webbrowser control to display and run captured html, added html components (checkboxes) and javascript. The rendered html works perfectly. However, in the control the javascript is not working at all. I don't think the webbrowser control knows what to do with the js. I have a particular html checkbox with an onclick event calling the js function 'allCheck(this)'. When I click on the checkbox the js is supposed to set all the other check boxes to the same state as the one calling. When I load the html and js in the IE10 browser (using a local file) everything works normally including the js. When I try to execute the same text in the webbrowser control (not loaded from a local file but generated within the program) the HTML is rendered correctly but when clicking the checkbox with the 'onclick' event the error message:

"The value of the property <function name> is null or undefined, not a Function object" results.

It seems the webbrowser control is unaware of the js between the <SCRIPT type=text/javascript> and </SCRIPT> html tags.

The calling 'onclick' looks like this:
Code:
<input type='checkbox' name='incidentHeader' onclick=checkAll(this)>
The function looks like this (this was provided by Phil):
Code:
<script type=text/javascript>
 function checkAll(controlObj)
 {
     var check =new Array();
     check = document.getElementsByName('incident');

     for(var i=0;i<check.length;i++)
     {
          check[i].checked = controlObj.checked;
     }
 }
 </SCRIPT>
I appreciate any input as to why the webbrowser control is not processing the js and what I can do to enable it. Or if the control just cannot do this is there a web browser control that does, preferably free?


Thanks,
Lamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top