Simple jscript error!

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>
 
G

Guest

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.
 
A

Artur-ek

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top