[jQuery] Re: val() and change()

2007-06-12 Thread Dan G. Switzer, II
Josh, >Actually, there currently isn't a programmatic way to set the value >and have it be masked automagically for the developer. I just wanted >to see if I could hook into existing methods to keep from having to >add too much syntax. It's driven off of focus,blur,keypress and >pasting(on cert

[jQuery] Re: val() and change()

2007-06-12 Thread Josh Bush
Actually, there currently isn't a programmatic way to set the value and have it be masked automagically for the developer. I just wanted to see if I could hook into existing methods to keep from having to add too much syntax. It's driven off of focus,blur,keypress and pasting(on certain browsers

[jQuery] Re: val() and change()

2007-06-12 Thread Dan G. Switzer, II
>That's kind of what I was thinking. I was hoping that their might be >a better way. I'd advise against doing that by default. I suppose you could add it as config option for those users that might not have any control over how the field is being updated. I would think that would be exception

[jQuery] Re: val() and change()

2007-06-12 Thread Josh Bush
That's kind of what I was thinking. I was hoping that their might be a better way. On Jun 12, 3:43 pm, "Dan G. Switzer, II" <[EMAIL PROTECTED]> wrote: > Josh, > > >My goal was to detect a val() call from within my masked input plugin. > > >So, when someone says "$("#id").maskedinput('(999) 999-9

[jQuery] Re: val() and change()

2007-06-12 Thread Dan G. Switzer, II
Josh, >My goal was to detect a val() call from within my masked input plugin. > >So, when someone says "$("#id").maskedinput('(999) 999-')" , I >would love to be able to detect when that value had been set >programatically and then re-check the masking. The only way I know to do that, would

[jQuery] Re: val() and change()

2007-06-12 Thread Klaus Hartl
Dan G. Switzer, II wrote: Josh, One more quick thing, is it possible to attach this to the val() of a single input, or am I limited to extending this globally? Instead of calling the below method "val" call it something else--like "valChange()" or something. Then just call that new method an

[jQuery] Re: val() and change()

2007-06-12 Thread Josh Bush
My goal was to detect a val() call from within my masked input plugin. So, when someone says "$("#id").maskedinput('(999) 999-')" , I would love to be able to detect when that value had been set programatically and then re-check the masking. So, if someone does a "$("#id").val('555-867-5309'

[jQuery] Re: val() and change()

2007-06-12 Thread Dan G. Switzer, II
Josh, >One more quick thing, is it possible to attach this to the val() of a >single input, or am I limited to extending this globally? Instead of calling the below method "val" call it something else--like "valChange()" or something. Then just call that new method any time you want the change e

[jQuery] Re: val() and change()

2007-06-12 Thread Dan G. Switzer, II
>Thank you. Any idea how I could attach to regular javascript call like >" x.value='something' "? You're not going to be able to do that in any kind of cross-browser way. Just use a jQuery method/plug-in. -Dan

[jQuery] Re: val() and change()

2007-06-12 Thread Josh Bush
One more quick thing, is it possible to attach this to the val() of a single input, or am I limited to extending this globally? On Jun 12, 2:44 pm, "Dan G. Switzer, II" <[EMAIL PROTECTED]> wrote: > Josh, > > >I was just wondering, should a val() call invoke a change event? If > >not, is there a

[jQuery] Re: val() and change()

2007-06-12 Thread Josh Bush
Thank you. Any idea how I could attach to regular javascript call like " x.value='something' "? On Jun 12, 2:44 pm, "Dan G. Switzer, II" <[EMAIL PROTECTED]> wrote: > Josh, > > >I was just wondering, should a val() call invoke a change event? If > >not, is there a good way to emulate this behavio

[jQuery] Re: val() and change()

2007-06-12 Thread Dan G. Switzer, II
Josh, >I was just wondering, should a val() call invoke a change event? If >not, is there a good way to emulate this behavior. You could overwrite the default behavior: $.fn.extend({ val: function( val ) { return val == undefined ? ( this.length