Simple jscript error!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I simply added an html button and textfield on an ASP.NET web page. Then on
the onclick event of the button I try to display a text on the textfield but
I get a script error. Here is the whole html contect of the web page:

<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<script id="clientEventHandlersJS" language="javascript">
<!--
function htmlButtton_onclick() {
htmlText.value = "Hello";
}
//-->
</script>
</HEAD>

<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<INPUT id="htmlButtton" style="Z-INDEX: 101; LEFT: 440px; POSITION:
absolute; TOP: 120px" type="button" value="Button" language="javascript"
onclick="return htmlButtton_onclick()">
<INPUT id="htmlText" style="Z-INDEX: 102; LEFT: 240px; POSITION: absolute;
TOP: 120px" type="text">
</form>
</body>
</HTML>
 
By the way,
If I try to navigate from inside the event handler it works, but assigning
to the text field doesn't.

Thank you.
 
Nad said:
Hello,

I simply added an html button and textfield on an ASP.NET web page. Then
on
the onclick event of the button I try to display a text on the textfield
but
I get a script error. Here is the whole html contect of the web page:
function htmlButtton_onclick() {
htmlText.value = "Hello";

document.forms[0].htmlText.value = "Hello"; works
 
Thank you, I think I need some studying before I go further. Do you know of
any online jscript tutorial or something?


Artur-ek said:
Nad said:
Hello,

I simply added an html button and textfield on an ASP.NET web page. Then
on
the onclick event of the button I try to display a text on the textfield
but
I get a script error. Here is the whole html contect of the web page:
function htmlButtton_onclick() {
htmlText.value = "Hello";

document.forms[0].htmlText.value = "Hello"; works
 
Back
Top