[jQuery] Re: .val is not a function

2009-01-29 Thread trancehead

At Last!

Thanks for the insight.

William

On Jan 29, 4:42 pm, Ricardo Tomasi  wrote:
> You're returning a plain HTML Element, not a jQuery object.
>
> Either change
>
> return $("[id*='" + elementId + "']", $(context))[0];
> to
> return $("[id*='" + elementId + "']", $(context));
>
> or change
>
> return getElementWithContext(elementId, context).val;
> to
> return $( getElementWithContext(elementId, context) ).val();
>
> - ricardo
>
> On Jan 29, 10:26 am, trancehead  wrote:
>
> > Hi,
>
> > I've tried it with the brackets as well. Same result.
>
> > I forgot to mention that getElementWithContext  is defined as
>
> > // Returns the element using JQuery to find ASP.NET control ID  -
> > includes context for speed
> > getElementWithContext = function(elementId, context) {
> >     // Returns all elements that end with the elementId
> >     return $("[id*='" + elementId + "']", $(context))[0];
>
> > }
>
> > This is from firebug:
> > getElementWithContext(elementId, context).val is not a function
> > [Break on this error] return getElementWithContext(elementId,
> > context).val();
>
> > William
> > On Jan 29, 2:11 pm, Stephan Veigl  wrote:
>
> > > And that's right, ".val" is NO function,
> > > the function is ".val()".
>
> > > by(e)
> > > Stephan
>
> > > 2009/1/29 trancehead :
>
> > > > All the core functions for JQuery seem to have stopped working.
>
> > > > Jquery is the first script include so it appears before the other
> > > > functions.
> > > > 
> > > > 

[jQuery] Re: .val is not a function

2009-01-29 Thread Ricardo Tomasi

You're returning a plain HTML Element, not a jQuery object.

Either change

return $("[id*='" + elementId + "']", $(context))[0];
to
return $("[id*='" + elementId + "']", $(context));

or change

return getElementWithContext(elementId, context).val;
to
return $( getElementWithContext(elementId, context) ).val();

- ricardo

On Jan 29, 10:26 am, trancehead  wrote:
> Hi,
>
> I've tried it with the brackets as well. Same result.
>
> I forgot to mention that getElementWithContext  is defined as
>
> // Returns the element using JQuery to find ASP.NET control ID  -
> includes context for speed
> getElementWithContext = function(elementId, context) {
>     // Returns all elements that end with the elementId
>     return $("[id*='" + elementId + "']", $(context))[0];
>
> }
>
> This is from firebug:
> getElementWithContext(elementId, context).val is not a function
> [Break on this error] return getElementWithContext(elementId,
> context).val();
>
> William
> On Jan 29, 2:11 pm, Stephan Veigl  wrote:
>
> > And that's right, ".val" is NO function,
> > the function is ".val()".
>
> > by(e)
> > Stephan
>
> > 2009/1/29 trancehead :
>
> > > All the core functions for JQuery seem to have stopped working.
>
> > > Jquery is the first script include so it appears before the other
> > > functions.
> > > 
> > > 

[jQuery] Re: .val is not a function

2009-01-29 Thread trancehead

Hi,

I've tried it with the brackets as well. Same result.

I forgot to mention that getElementWithContext  is defined as

// Returns the element using JQuery to find ASP.NET control ID  -
includes context for speed
getElementWithContext = function(elementId, context) {
// Returns all elements that end with the elementId
return $("[id*='" + elementId + "']", $(context))[0];
}

This is from firebug:
getElementWithContext(elementId, context).val is not a function
[Break on this error] return getElementWithContext(elementId,
context).val();

William
On Jan 29, 2:11 pm, Stephan Veigl  wrote:
> And that's right, ".val" is NO function,
> the function is ".val()".
>
> by(e)
> Stephan
>
> 2009/1/29 trancehead :
>
>
>
> > All the core functions for JQuery seem to have stopped working.
>
> > Jquery is the first script include so it appears before the other
> > functions.
> > 
> > 

[jQuery] Re: .val is not a function

2009-01-29 Thread Stephan Veigl

And that's right, ".val" is NO function,
the function is ".val()".


by(e)
Stephan


2009/1/29 trancehead :
>
> All the core functions for JQuery seem to have stopped working.
>
> Jquery is the first script include so it appears before the other
> functions.
> 
>