[jQuery] Form Handling

2006-08-17 Thread Menier, Todd








Another
newbie question. I was looking at some cool form handling features of prototype
(about half-way down this article: http://www.sitepoint.com/print/painless-_javascript_-prototype)
and was trying to figure out jQuery has similar features. I'm a little confused
 I see the form plugin referenced from http://proj.jquery.com/plugins does
some of what I'm looking for (such as serialize), but it also looks like some (maybe
all?) of this functionality is already baked into the core jQuery library. Is this
just simply not documented yet? Is there a good current overview of the latest
built-in form handling features?



2
specific functions of prototype that I think look particularly useful are
Form.Observer and Form.EventObserver. The former checks all form fields at a specified
periodic interval and calls a specified callback if anything changes. The
latter is similar only it listens for all relevant change events (onchange,
onclick) of all form fields rather than polling at intervals. Does the core
jQuery and/or an existing plugin have a similar feature? Sorry if I completely
missed it - I dug around a bit and didn't find anything.



Also,
until the new site is launched, is proj.jquery.com the place to go (rather than
jquery.com) for the most current info and documentation?



Thanks!

Todd








___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery form handling

2006-08-11 Thread Larry Garfield
Hm, spiffy.  If I wanted to get an element that didn't have an ID, I
should be able to do that with something like:

$('[EMAIL PROTECTED]myfield]').val();

Right?  What about multi-value fields like select boxes or radio button sets?

-- 
Larry Garfield

On Fri, August 11, 2006 10:25 am, Andy Matthews said:
 jQuery has great ways to interact with forms built right in.

 $('#formfieldID').val() gets the value
 $('#formfieldID').val(someVar) sets the value

 Those are just the two basics. There's loads more built in.

 !//--
 andy matthews
 web developer
 certified advanced coldfusion programmer
 ICGLink, Inc.
 [EMAIL PROTECTED]
 615.370.1530 x737
 --//-

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Behalf Of Larry Garfield
 Sent: Friday, August 11, 2006 10:14 AM
 To: discuss@jquery.com
 Subject: [jQuery] jQuery form handling


 Hey folks.  I'm evaluating jQuery for my company, and have a few questions
 that I've not been able to find answers to in the Docs on the site yet.

 The major question I have is about form handling.  Specifically, does
 jQuery (either core or a well-supported plugin) provide functions to
 easily manage forms?  By manage, I mean things like pulling values out,
 setting or changing form values programmatically, attaching events in a
 browser-independent way (Safari and events are vil, IME), validation
 rules, etc.  Compound form elements (date pickers, time pickers, drag-drop
 ordering of elements in a multi-select box, etc.) are good, too.

 Where does jQuery stand on these?  I'm hoping well, but am not sure
 presently. :-)  Thanks.

 --
 Larry Garfield




 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery form handling

2006-08-11 Thread Mike Alsup
It was originally written the way you suggested but John rearranged
them in svn v97.  You'll have to ask him why.  But I agree that
pre/post is a more natural ordering.

 Wouldn't it make more sense if it was preCallback then postCallback -

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery form handling

2006-08-11 Thread Andy Matthews
I believe that would be this:

$('[EMAIL PROTECTED]myfield]')get[0].val();

Where 0 relates to the order of the items?

!//--
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--//-

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Larry Garfield
Sent: Friday, August 11, 2006 10:35 AM
To: jQuery Discussion.
Subject: Re: [jQuery] jQuery form handling


Hm, spiffy.  If I wanted to get an element that didn't have an ID, I
should be able to do that with something like:

$('[EMAIL PROTECTED]myfield]').val();

Right?  What about multi-value fields like select boxes or radio button
sets?

--
Larry Garfield

On Fri, August 11, 2006 10:25 am, Andy Matthews said:
 jQuery has great ways to interact with forms built right in.

 $('#formfieldID').val() gets the value
 $('#formfieldID').val(someVar) sets the value

 Those are just the two basics. There's loads more built in.

 !//--
 andy matthews
 web developer
 certified advanced coldfusion programmer
 ICGLink, Inc.
 [EMAIL PROTECTED]
 615.370.1530 x737
 --//-

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Behalf Of Larry Garfield
 Sent: Friday, August 11, 2006 10:14 AM
 To: discuss@jquery.com
 Subject: [jQuery] jQuery form handling


 Hey folks.  I'm evaluating jQuery for my company, and have a few questions
 that I've not been able to find answers to in the Docs on the site yet.

 The major question I have is about form handling.  Specifically, does
 jQuery (either core or a well-supported plugin) provide functions to
 easily manage forms?  By manage, I mean things like pulling values out,
 setting or changing form values programmatically, attaching events in a
 browser-independent way (Safari and events are vil, IME), validation
 rules, etc.  Compound form elements (date pickers, time pickers, drag-drop
 ordering of elements in a multi-select box, etc.) are good, too.

 Where does jQuery stand on these?  I'm hoping well, but am not sure
 presently. :-)  Thanks.

 --
 Larry Garfield




 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery form handling

2006-08-11 Thread John Resig
 $('[EMAIL PROTECTED]myfield]')get[0].val();

Nope, what he had was just fine - doing a .val() gets the value of the
first element matched.

--John

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery form handling

2006-08-11 Thread Andy Matthews
Ah

Thank you John.

!//--
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--//-

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of John Resig
Sent: Friday, August 11, 2006 12:49 PM
To: jQuery Discussion.
Subject: Re: [jQuery] jQuery form handling


 $('[EMAIL PROTECTED]myfield]')get[0].val();

Nope, what he had was just fine - doing a .val() gets the value of the
first element matched.

--John

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/