Simple jscript error!

Discussion in 'ASP .Net' started by =?Utf-8?B?TmFk?=, May 23, 2005.

  1. 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>
     
    =?Utf-8?B?TmFk?=, May 23, 2005
    #1
    1. Advertising

  2. 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" wrote:

    > 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>
     
    =?Utf-8?B?TmFk?=, May 23, 2005
    #2
    1. Advertising

  3. =?Utf-8?B?TmFk?=

    Artur-ek Guest

    "Nad" <> wrote in message
    news:...
    > 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


    --
    Artur Borecki
    aboreckiATtenbit.pl
     
    Artur-ek, May 23, 2005
    #3
  4. Thank you, I think I need some studying before I go further. Do you know of
    any online jscript tutorial or something?


    "Artur-ek" wrote:

    >
    > "Nad" <> wrote in message
    > news:...
    > > 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
    >
    >
    > --
    > Artur Borecki
    > aboreckiATtenbit.pl
    >
    >
    >
     
    =?Utf-8?B?TmFk?=, May 24, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jenny

    Simple JScript

    Jenny, Aug 11, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    920
    Prasad
    Aug 11, 2003
  2. Jon Maz
    Replies:
    4
    Views:
    1,282
    Jon Maz
    Sep 9, 2004
  3. Maxwell2006
    Replies:
    5
    Views:
    2,414
    Steven Cheng[MSFT]
    Mar 7, 2006
  4. John Bentley
    Replies:
    14
    Views:
    366
    Jim Ley
    Feb 5, 2004
  5. VK
    Replies:
    4
    Views:
    362
    Thomas 'PointedEars' Lahn
    Jan 12, 2006
Loading...

Share This Page