How can I use onchange event

Discussion in 'ASP General' started by Jack, Dec 4, 2003.

  1. Jack

    Jack Guest

    Hello,
    I wrote this code:
    <%@ Language=VBScript %>
    <%
    Response.Write "<SELECT id=Customer name=Customer
    onchange=""text152='abc'"">"
    Response.Write "<OPTION value=1>One"
    Response.Write "<OPTION value=2>Two"
    Response.Write "<OPTION value=3>Three"
    Response.Write "</SELECT>"
    Response.Write "<BR>"
    Response.Write "<INPUT type=""text"" id=text152 name=text152>"
    Response.Write "<BR>"
    %>

    But change the SELECT,onchange event not been called
    Can you help me
     
    Jack, Dec 4, 2003
    #1
    1. Advertising

  2. Hi,

    Create a JavaScript function and then call the function on the OnChange event. Like

    <select id="customer" name="customer" onChange="javascript:fnDoSomething()">

    Where fnDoSomething() is the name of your JavaScript function.

    Regards,
    Bhaskardeep Khaund
     
    Bhaskardeep Khaund, Dec 4, 2003
    #2
    1. Advertising

  3. Jack

    Ray at Guest

    This isn't an ASP issue, as onchange is a client-side event. Try asking in
    client-side scripting group such as .scripting.jscript.

    Ray at work

    "Jack" <> wrote in message
    news:...
    > Hello,
    > I wrote this code:
    > <%@ Language=VBScript %>
    > <%
    > Response.Write "<SELECT id=Customer name=Customer
    > onchange=""text152='abc'"">"
    > Response.Write "<OPTION value=1>One"
    > Response.Write "<OPTION value=2>Two"
    > Response.Write "<OPTION value=3>Three"
    > Response.Write "</SELECT>"
    > Response.Write "<BR>"
    > Response.Write "<INPUT type=""text"" id=text152 name=text152>"
    > Response.Write "<BR>"
    > %>
    >
    > But change the SELECT,onchange event not been called
    > Can you help me
    >
     
    Ray at, Dec 4, 2003
    #3
  4. Jack

    Jack Guest

    Thank you
     
    Jack, Dec 4, 2003
    #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. Zeebra3
    Replies:
    5
    Views:
    5,163
    pelegk1
    Jul 15, 2007
  2. MDBloemker
    Replies:
    2
    Views:
    2,877
  3. Norm via DotNetMonster.com

    using the client side "onchange" event function

    Norm via DotNetMonster.com, Jun 15, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    4,890
    Norm via DotNetMonster.com
    Jun 15, 2005
  4. Zeebra3
    Replies:
    3
    Views:
    187
    Ken Cox [Microsoft MVP]
    Aug 8, 2003
  5. William  Cole
    Replies:
    2
    Views:
    142
Loading...

Share This Page