www.webdeveloper.com
Results 1 to 4 of 4

Thread: javascript problem (onchange-onkeyup)

  1. #1
    Join Date
    May 2009
    Posts
    2

    javascript problem (onchange-onkeyup)

    hi

    i have a textbox and it has onchange and onkeyup event.

    when i use "this.value=xxx" in onkeyup, onchange does not work.

    but if i dont use this.value=xxx in onkeyup everything is okey.

    this is working.alert ok.
    <asp:TextBox ID="TextBox1" runat="server"
    onchange="javascript:alert('aa');"
    onkeyup="alert(bb');"
    ></asp:TextBox>

    but this isn't working.there is not alert.
    <asp:TextBox ID="TextBox1" runat="server"
    onchange="javascript:alert('aa');"
    onkeyup="javascript:this.value='1';"
    ></asp:TextBox>

    it is so simple but i cant fix it.

    any help?

  2. #2
    Join Date
    Apr 2009
    Posts
    48
    either you are on wrong forum or you are asking wrong question. your code involves lots of asp code.

  3. #3
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    onchange will fire the function only if both following actions were made: the element has lost its focus AND its value was changed. Use onblur instead of onchange.

  4. #4
    Join Date
    May 2009
    Posts
    2
    Thanks Kor

    onblur worked

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles