Hi Dailce,

You're probably after something like this: http://jsfiddle.net/ewtXa/ (or, if you prefer to declare your functions elsewhere, like this: http://jsfiddle.net/ewtXa/1/ . This fiddle ( http://jsfiddle.net/ewtXa/2/ ) might also be of use when choosing your events. :) Note that when I paste into the input (in Firefox 4b12, at least), the value of the input in the keyup handler includes the pasted content.

What exactly are you trying to achieve with this? Do you really need to be doing work as the input's contents is changed, or can you use the change handler to do everything?

On 02/03/11 08:34, Dailce wrote:
I figure for the input I can use, the code below, but how can I create
a custom function to call outside the "addEvents"?
Not sure about the proper format, since it's in the domready.

window.addEvent('domready', function() {

customfunctionA( do something ) //how to call/write this?

$('myElement').addEvents({
     blur: function(){
         customfunctionA;
     },
     keyup: function(){
         customfunctionA;
     }
});

});


--
Barry van Oudtshoorn
www.barryvan.com.au

Not sent from my Apple πPhone.

Reply via email to