2 Replies Latest reply on Dec 2, 2011 10:01 AM by pacman90

    h:inputTextarea value change

    pacman90

      hello,

      I have a question about <h:inputTextarea> component's value change event. If it's value is changed (by keypresses, setValue(), copy-paste etc.), immediately i need to run a javascript function. onchange runs when it loses its focus. Neither onchange event nor valueChangeListener solved problem. I need something like :

      <h:inputTextarea onvaluechange='alert('value changed');'>

      What do i need to do?

       

      thank you

        • 1. Re: h:inputTextarea value change
          mcmurdosound

          I think for paste-events you'll need jQuery. For everythink else (like onkeypress) you could use an ordinary a4j:support.

           

          <a4j:support event="onkeyup" oncomplete="console.log(this); console.log(event);"></a4j:support>

           

           

          jQuery:

           

          jQuery("#someid")..bind('paste', function(e){console.log(e);});

          • 2. Re: h:inputTextarea value change
            pacman90

            Thank you for your reply christian,

            Jquery will not be used, because jquery is not included in our project. Only javascript will be used.

            I thought that an "onrender" event should solve my problem with a4j:support. But i couldnt.

             

            thank you