.
>
> > -- Josh
>
> > - Original Message -
> > From: "briandichiara" <[EMAIL PROTECTED]>
> > To: "jQuery (English)"
> > Sent: Thursday, May 08, 2008 1:58 PM
> > Subject: [jQuery] Re: Getting Parent Element using "
; <[EMAIL PROTECTED]>
> To: "jQuery (English)"
> Sent: Thursday, May 08, 2008 1:58 PM
> Subject: [jQuery] Re: Getting Parent Element using "this"
>
> > Ok, I tried this:
>
> > $(elm).parents().map(function () {
> > alert(this.tagName);
> &g
If there is as little control over the markup as is implied then a
more generic solution might be applicable (untested!)?
function updateQuote(el){
//$('form') could be cached, and may not need to store parentForm...
var parentForm = $('form').filter(function(){
var i = this.elements.le
With markup as invalid as that, it's no surprise that elements are not where
you expect them in to be in the DOM. A FORM element can't be sandwiched in
between a TABLE and TR like that. So the browser tries to turn this into
something it can work with. It may shuffle things around, or just put up
ot;jQuery (English)"
Sent: Thursday, May 08, 2008 1:58 PM
Subject: [jQuery] Re: Getting Parent Element using "this"
Ok, I tried this:
$(elm).parents().map(function () {
alert(this.tagName);
});
but the FORM never shows up. Reason is because the source looks like
this:
ok, i'm not sure if this is the easiest way, however, this is how I
got the form action in the following HTML:
Ok, I tried this:
$(elm).parents().map(function () {
alert(this.tagName);
});
but the FORM never shows up. Reason is because the source looks like
this:
> I don't know why my reply's aren't showing up, but:
>
> What if the first parent is not a form (like it could be a
> label or div)? and also, I would like to avoid using the
> "name=something" just because the name could change without
> me knowing it.
Assuming you have a DOM element in 'th
I don't know why my reply's aren't showing up, but:
What if the first parent is not a form (like it could be a label or
div)? and also, I would like to avoid using the "name=something" just
because the name could change without me knowing it.
Thanks for the help.
On May 8, 2:30 pm, "Josh Nathan
Also, i'd rather not "commit" anything i.e. using "name=blah" in case
the name gets changed. without me knowing.
On May 8, 2:30 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:
> jQuery is even easier than that. You can remove the need to put your
> onchange inline like so:
>
> var formAction = n
what if the parent element is not a form. like:
On May 8, 2:30 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:
> jQuery is even easier than that. You can remove the need to put your
> onchange inline like so:
>
> var formAction = null;
>
> $("select[name=some_name]").change(function() {
>
jQuery is even easier than that. You can remove the need to put your
onchange inline like so:
var formAction = null;
$("select[name=some_name]").change(function() {
formAction = $(this).parent().attr("action");
});
This binds the anonymous function to set the variable formAction, to the
12 matches
Mail list logo