[jQuery] Re: Form plugin: input elements excluded

2009-04-27 Thread dth

Aha!

I guess it must be because the dialog is moved to be the last element
of the body element, and thus outside of the form.

I guess that's necesarry for absolute placement  etc.

I'll see if I manually can pick up the extra field values. Suggestions
are welcome :)

-dennis

On Apr 27, 11:11 am, dth dennis.thry...@gmail.com wrote:
 According to firebug not much is altered, and the fields should be
 included in the form as far as I can tell. But they aren't :/


[jQuery] Re: Form plugin: input elements excluded

2009-04-27 Thread dth

Hi,

Is there someone on the list with detailed knowledge of how browsers
handle input fields. Or somebody that knows in detail what the jquery-
ui plugin actually does to a div.

According to firebug not much is altered, and the fields should be
included in the form as far as I can tell. But they aren't :/

Thanks,

-dennis

On Apr 26, 2:13 pm, dth dennis.thry...@gmail.com wrote:
 As far as I can tell they should all be just fine. If I disable the
 jquery-ui-dialog and just display the fields (in tabs) in the page,
 they work just fine.

 So it must be caused by the dialog plugin somehow.

 I have text inoput fields and checkboxes. They all have names. None
 are disabled (unless the dialog plugin is doing that).

 Hmm. How odd.

 The source is here:http://pastebin.com/m6243ec55

 The dialog is identified as #horseOptionsDialog.

 -dennis

 On 26 Apr., 14:07, Mike Alsup mal...@gmail.com wrote:

  No, hidden form fields are not excluded.  What does your markup look
  like?  There are several reasons that inputs would not be submitted:

  - the input does not have a name attribute
  - the input is disabled
  - the input is a checkbox or radio and is not checked

  Only successful[1] form elements are submitted.


[jQuery] Form plugin: input elements excluded

2009-04-26 Thread dth

Hi,

I'm using the form plugin to submit a form by ajax. But oddly some of
my form fields aren't included in the form.

As far as I can tell by debugging, the elements are found by the
browsers form.elements property.

I don't know why some of the form input elements aren't included but
it seems to be caused by these elements being in a div that is made
into a dialog.

Are hidden form fields not included? Any ideas on how to circumvent
this?

Thanks,

-dennis


[jQuery] Re: Form plugin: input elements excluded

2009-04-26 Thread dth

As far as I can tell they should all be just fine. If I disable the
jquery-ui-dialog and just display the fields (in tabs) in the page,
they work just fine.

So it must be caused by the dialog plugin somehow.

I have text inoput fields and checkboxes. They all have names. None
are disabled (unless the dialog plugin is doing that).

Hmm. How odd.

The source is here: http://pastebin.com/m6243ec55

The dialog is identified as #horseOptionsDialog.

-dennis

On 26 Apr., 14:07, Mike Alsup mal...@gmail.com wrote:
 No, hidden form fields are not excluded.  What does your markup look
 like?  There are several reasons that inputs would not be submitted:

 - the input does not have a name attribute
 - the input is disabled
 - the input is a checkbox or radio and is not checked

 Only successful[1] form elements are submitted.


[jQuery] Removing anonymous element

2009-04-22 Thread dth

Hi,

I have a jquery array with an element in it. I'd like to remove this
element from the DOM, but can't see how.

If I use var.remove() it removes all children but not the element
itself.

I cannot think of any way to specify this very element in a selector
either, as it can have various placements in the DOM and it doesn't
have an id.

If there was a good mechanism for generating unique ids maybe that
would be the way to go?

Thanks,

-dennis


[jQuery] Re: Removing anonymous element

2009-04-22 Thread dth

As far as I can see, that would remove my element as well as all of
it's siblings?

-dennis


On 22 Apr., 13:36, Daniel dcosta...@gmail.com wrote:
 var.parent().remove() should do the trick i think?


[jQuery] Re: Removing anonymous element

2009-04-22 Thread dth

But it does :)

I have

div
  a/
  b/
/div

I have a jquery reference to b that was obtained earlier. If I
invoke .parent().remove() it removes all children of the parent - that
is both a and b. I only wish to remove b.

Thanks,

-dennis


On 22 Apr., 13:48, Daniel dcosta...@gmail.com wrote:
 Wait. I'm sorry... the second half of my response was for a different
 post relating to parent and parents. I have not tested that in the
 wild. It should, however, not remove the siblings for the same
 reason.

 On Apr 22, 6:45 am, Daniel dcosta...@gmail.com wrote:

  It shouldn't. there is parent() and parents().
  I use that exact code for a tag system that i created. I'd link you to
  it... but it's not public yet. The code is exact, the properties
  changed are different.

  On Apr 22, 6:40 am, dth dennis.thry...@gmail.com wrote:

   As far as I can see, that would remove my element as well as all of
   it's siblings?

   -dennis

   On 22 Apr., 13:36, Daniel dcosta...@gmail.com wrote:

var.parent().remove() should do the trick i think?


[jQuery] Re: jquery form plugin problem

2009-03-29 Thread dth

On 29 Mar., 02:46, Mike Alsup mal...@gmail.com wrote:
 Well there must be more to the story than what you're telling us.  The
 code you've shown above looks fine.  Perhaps there is a problem with
 the json response.

Actually that was excactly the problem. It would be good to get some
kind of notification though. Perhaps a javascript error in the browser
console or a failure function to complement the success one.

  Oh, and by the way. Is there any way to get access to the request in
  the 'success' function - to obtain status codes, content-type header
  etc.?

 No, not in the success function.  But you can use the 'complete'
 function to get access to the xhr.

 complete: function(xhr, status) {
   ...

 }

Cool, you should mention that on the website :)

Oh wait - this would kind of be the failure function mentioned
above. I actually get parsererror as statustext in the complete
function. Just didn't know about it :)

Thanks,

-dennis


[jQuery] jquery form plugin problem

2009-03-28 Thread dth

Hi,

I'm trying to use the form plugin from malsup.org to submit a form
with ajax, but it does not seem to work with options.

This works:

$(#loginform).ajaxSubmit(function(obj,
statusText) {
alert(obj);
});

This does not work (nothing happens):

$(#loginform).ajaxSubmit({
dataType: json,
success: function(obj, statusText) {
alert(obj);
}
});

Oh, and by the way. Is there any way to get access to the request in
the 'success' function - to obtain status codes, content-type header
etc.?

Thanks,

-dennis


[jQuery] jquery form plugin problem

2009-03-28 Thread dth

Hi,

I'm having a problem with the jquery (ajax) form plugin. It says on
the page (malsup.com) to seek help here :)

When I invoke ajaxSubmit() with a function it is called on success.
But when I invoke ajaxSubmit() with a Options object with success:
function() {..} the function is not invoked. Any help appreciated!

By the way: is there any (good) way to access the response status code
and content type from the success callback function?

Thanks,

-dennis


[jQuery] jquery form plugin problem

2009-03-28 Thread dth

Hi,

I'm trying to use the form plugin from malsup.org to submit a form
with ajax, but it does not seem to work with options.

This works:

$(#loginform).ajaxSubmit(function(obj,
statusText) {
alert(obj);
});

This does not work (nothing happens):

$(#loginform).ajaxSubmit({
dataType: json,
success: function(obj, statusText) {
alert(obj);
}
});

Oh, and by the way. Is there any way to get access to the request in
the 'success' function - to obtain status codes, content-type header
etc.?

Thanks,

-dennis