Thanks! Looks perfect.

On Oct 12, 12:40 am, Karl Swedberg <k...@englishrules.com> wrote:
> On Oct 11, 2009, at 3:35 PM, Jason wrote:
>
>
>
> > Can someone explain a little bit more (more then jQuery's docs) about
> > how the $.post operates?  I know it's a "shortcut" for .ajax and it
> > uses the HTTP POST request.  So I'm guessing it's not sending the same
> > request the form would send... i.e. you HAVE to provide the data to
> > the php script through $.post.  Is that correct?  Then my next
> > question is, if I have a set of check boxes and name each box  
> > "services
> > []"... PHP will load the value of each into an array.  Is there a
> > quick way to assign these value to a JS variable to pass onto the PHP
> > script?  Because PHP doesn't create that array until the POST request,
> > correct?  But since I am using $.post, PHP is not making the request,
> > therefore doesn't create the array.  Is that right?  So I must do it
> > manually in JS... what would be best/quickest way to go about this?
> > Thanks for the help.
>
> You can send the form's input values as a serialized string  
> using .serialize(). So, if you have a form with id="foo" you could do  
> something like this:
>
> $('#foo').submit() {
>    var formData = $(this).serialize();
>    $.post('/path/to/file/', formData, function() {
>      // do something when post is successful.
>    });
>    return false;
>
> });
>
> --Karl
>
> ____________
> Karl Swedbergwww.englishrules.comwww.learningjquery.com

Reply via email to