jQuery: The Write Less, Do More JavaScript Library

Check form before submit with ajax

View: New views
3 Messages — Rating Filter:   Alert me  

Check form before submit with ajax

by BMnt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm building a web form with containing 3 fields. When the form is
submitted a search is done in a database, everything is ok.

Now, in order to help the user, I would like to display on the form
the number of results he will get if the form is submitted.
What's the best way to get this behaviour?

With a single field it's quite easy ($.get or $.load), but when I add
multiple checkboxes or multiple select, the construction I cannot
build the request anynmore...

Can someone give me some hints to build my form?

Thanks,

R: Check form before submit with ajax

by Salvatore FUSTO-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Use the $.ajax() function: in it among other you can specify a structure of
data to pass to your action page
 

-----Messaggio originale-----
Da: BMnt [mailto:bmontereau@...]
Inviato: venerdì 6 novembre 2009 23.29
A: jQuery (English)
Oggetto: [jQuery] Check form before submit with ajax

I'm building a web form with containing 3 fields. When the form is
submitted a search is done in a database, everything is ok.

Now, in order to help the user, I would like to display on the form
the number of results he will get if the form is submitted.
What's the best way to get this behaviour?

With a single field it's quite easy ($.get or $.load), but when I add
multiple checkboxes or multiple select, the construction I cannot
build the request anynmore...

Can someone give me some hints to build my form?

Thanks,


Re: R: Check form before submit with ajax

by BMnt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Salvatore,
Thank you for your response. Do you have a basic example to see how to
use this function?
Regards,
BMnt

On 7 nov, 10:12, "Salvatore FUSTO" <ing.fu...@...> wrote:

> Use the $.ajax() function: in it among other you can specify a structure of
> data to pass to your action page
>
> -----Messaggio originale-----
> Da: BMnt [mailto:bmonter...@...]
> Inviato: venerdì 6 novembre 2009 23.29
> A: jQuery (English)
> Oggetto: [jQuery] Check form before submit with ajax
>
> I'm building a web form with containing 3 fields. When the form is
> submitted a search is done in a database, everything is ok.
>
> Now, in order to help the user, I would like to display on the form
> the number of results he will get if the form is submitted.
> What's the best way to get this behaviour?
>
> With a single field it's quite easy ($.get or $.load), but when I add
> multiple checkboxes or multiple select, the construction I cannot
> build the request anynmore...
>
> Can someone give me some hints to build my form?
>
> Thanks,