Javascript event that fires without user interaction?

后端 未结 7 1356
离开以前
离开以前 2021-01-22 06:59

A textbox on my form may change depending on what\'s selected in various drop down lists.

Is there a way to call a javascript function when the textbox value changes? <

7条回答
  •  故里飘歌
    2021-01-22 07:34

    I'd recommend to look over YUI's Custom events for Example: YUI Custom Event Example Link

    All you need is to attach this script with Events manipulations

    
    

    and then you are able to use Custom Events (everywhere in HTML) fnSubscriberChange - inside this Func you could do whatever you want. You could put your textbox change value logic here and depend on the Changed Select box value - call desired func. Logic that depends on Event listening is clear and easy to modify; YUI library supports all browsers so you shouldnt mind about browsers features.

    Text box and select boxes:

     
        
        
    

    Script for events:

    
    

提交回复
热议问题