nasreen
03-10-2007, 06:57 PM
Hi All,
I am not much sure that I am in the real forum to post my this question. But I found this forum most suitable for my question.
My question is how to disable and enable the execution of a JavaScript function in a web page using DOM in VB6.
I have a project in VB6, checking some conditions in a third party webpage.
This web page has a JavaScript Function namely
<script language="javascript">
function next_clicked()
{
.......
.......
.......
}
</Script>
<input type="button" name="Submit" value="NEXT" onClick=next_clicked() >
In my project I check some conditions in some text fields of the web page. If these conditions are false I want to disable the execution of the function next_clicked() when the user clicks on the NEXT button.
And if the conditions are true I want to enable the execution of the same function upon the NEXT button click.
To disable the execution I wrote the following VB code and it work fine.
WebBrowser1.document.getElementsByName("Submit")(0).onclick = ""
But once it is disabled I cannot to enable again when the conditions are true.
If anybody has idea to enable the execution of this disabled function please help me.
With regards,
Nasreen
I am not much sure that I am in the real forum to post my this question. But I found this forum most suitable for my question.
My question is how to disable and enable the execution of a JavaScript function in a web page using DOM in VB6.
I have a project in VB6, checking some conditions in a third party webpage.
This web page has a JavaScript Function namely
<script language="javascript">
function next_clicked()
{
.......
.......
.......
}
</Script>
<input type="button" name="Submit" value="NEXT" onClick=next_clicked() >
In my project I check some conditions in some text fields of the web page. If these conditions are false I want to disable the execution of the function next_clicked() when the user clicks on the NEXT button.
And if the conditions are true I want to enable the execution of the same function upon the NEXT button click.
To disable the execution I wrote the following VB code and it work fine.
WebBrowser1.document.getElementsByName("Submit")(0).onclick = ""
But once it is disabled I cannot to enable again when the conditions are true.
If anybody has idea to enable the execution of this disabled function please help me.
With regards,
Nasreen