Results 1 to 3 of 3

Thread: Textfield onchange function...

  1. #1
    Contributing Member
    Join Date
    Sep 2006

    Textfield onchange function...

    In my html page, i am using the following code.

    input type="text" name="result" id="res" value="PASS" onchange="change_result();"

    The above function is working when the user change the text on the textfield. But if i change the value of the textfield dynamically(using javascript function)it is not working.

    Can anyone tell me why is not working? which function i am using here?


  2. #2
    Junior Member
    Join Date
    Dec 2006

    Re: Textfield onchange function...

    S...even i also face the same problem...
    I just give one example , check it out whether it works......
    function fun1()
    alert("Text Changed")
    function fun2()
    var mylist=document.getElementById("lang")

    form name=f>
    Language : select id=lang onchange=fun2(),fun1()>
    option selected>Java
    option>Dot Net

    Favorite Language is :input type=Text name=na value="hello" onchange=fun1()>


    Last edited by daisy_deepa; 06-02-2007 at 08:23 AM.

  3. #3
    Junior Member
    Join Date
    Feb 2009

    Re: Textfield onchange function...

    A client side code cannot call another client side function which is connected to a control as if the user types or moves the focus from the textfield the client side function would be called as the event takes place with the help of the user. but if the value of the textfield is changed thru a javascript function then the event onChange() wont fire as it looks for the user input change which doesnt happen in case of value change thru javascript..

    For more details visit:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.