Re: Change a div.innerhtml

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"Reventlov (see signature)" <noone@xxxxxxx> wrote in message
news:45eb3aac.282397@xxxxxxxxxxxxxxxxxxxxxx
Hi,
I'm working on my first hta. After pressing a button I want to clear the
client area (a
DIV section), do some processing and then put the new data in the DIV.
It happens that I can change the mydiv.innerhtml only once. If I clear the
div, nothing is
processed after it.
If I comment out the mydiv.innerhtml = " " all works fine and the result
is shown.

Is the only way to grey out the button in order to prevent other clicks?

Thank you
Giovanni

sub buttonClick()
mydiv.innerhtml = " "
' Processing.....
Resp = "click " & txt1.value
msgbox Resp
mydiv.innerhtml = Resp
end sub

Where/how is "txt1" declared?

I presumed it's a form text field so I changed the code and it works.

<html>
<head>
<title>div.hta</title>
<script type="text/vbscript">
sub buttonClick()
mydiv.innerhtml = " "
' Processing.....
Resp = "click " & document.forms(0).txt1.value
msgbox Resp
mydiv.innerhtml = Resp
end sub
</script>
</head>
<body>
<form>
<input type="text" name="txt1" valiue="Goodbye cruel world">
<input type="button" value="Click" onclick="buttonClick()">
</form>
<div id="mydiv" style="border:solid 1px black">Hello World</div>
</body>
</html>


.


Quantcast