[Proto-Scripty] Re: Need help sending information from multiple forms

2008-11-18 Thread Abel Figueiredo

Thank you for your help. It's working as expected :-)

On Nov 15, 3:32 am, kangax [EMAIL PROTECTED] wrote:
 On Nov 14, 11:52 am, Abel Figueiredo [EMAIL PROTECTED]
 wrote:

  This solution. Is it for same-named form controls? My solution doesn't
  have same-named controls.

  So with this i can send the return from mergeForms... as my
  parameters, right?

 Yes. Just pass it as many forms as you need.

 [...]

 --
 kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Need help sending information from multiple forms

2008-11-18 Thread Abel Figueiredo

I spoke too soon.

There's a little problem. One of the forms contains a select option.

When I click a button the merge function is called and the value shown
should be the selected one, but it's the first one instead.

At first I thought it could be something else and I've submitted that
particular form with $(form).serialize .

On 18 Nov, 09:58, Abel Figueiredo [EMAIL PROTECTED] wrote:
 Thank you for your help. It's working as expected :-)

 On Nov 15, 3:32 am, kangax [EMAIL PROTECTED] wrote:

  On Nov 14, 11:52 am, Abel Figueiredo [EMAIL PROTECTED]
  wrote:

   This solution. Is it for same-named form controls? My solution doesn't
   have same-named controls.

   So with this i can send the return from mergeForms... as my
   parameters, right?

  Yes. Just pass it as many forms as you need.

  [...]

  --
  kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Need help sending information from multiple forms

2008-11-18 Thread Mona Remlawi

Hi Abel,
Sorry I only skimmed through the thread here, so excuse me if my
response comes irrelevant.

Assuming forms is the array of forms you wanna submit, try the following:
var paramsObj = forms.collect(function(f) {return
f.serialize(false)}).join('').toQueryParams();

this basically merges the submit query of all the forms into one
queryString, then deserializes them into a Hash object.

cheers

--
mona
[EMAIL PROTECTED]

On Tue, Nov 18, 2008 at 11:38 AM, Abel Figueiredo
[EMAIL PROTECTED] wrote:

 I spoke too soon.

 There's a little problem. One of the forms contains a select option.

 When I click a button the merge function is called and the value shown
 should be the selected one, but it's the first one instead.

 At first I thought it could be something else and I've submitted that
 particular form with $(form).serialize .

 On 18 Nov, 09:58, Abel Figueiredo [EMAIL PROTECTED] wrote:
 Thank you for your help. It's working as expected :-)

 On Nov 15, 3:32 am, kangax [EMAIL PROTECTED] wrote:

  On Nov 14, 11:52 am, Abel Figueiredo [EMAIL PROTECTED]
  wrote:

   This solution. Is it for same-named form controls? My solution doesn't
   have same-named controls.

   So with this i can send the return from mergeForms... as my
   parameters, right?

  Yes. Just pass it as many forms as you need.

  [...]

  --
  kangax
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Need help sending information from multiple forms

2008-11-14 Thread kangax

On Nov 14, 11:52 am, Abel Figueiredo [EMAIL PROTECTED]
wrote:
 This solution. Is it for same-named form controls? My solution doesn't
 have same-named controls.

 So with this i can send the return from mergeForms... as my
 parameters, right?

Yes. Just pass it as many forms as you need.

[...]

--
kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Need help sending information from multiple forms

2008-11-13 Thread kangax

On Nov 13, 11:13 am, Abel Figueiredo [EMAIL PROTECTED]
wrote:
 Hello.

 I need a little help.

 I'm developing an application using prototype  php and I want to do
 the following:

 In a page I have 3 forms: One containing a start calendar, one
 containing a end calendar and one that allows the user to select witch
 data to show on a graph.

 The idea is to allow the user to use the two calendars to select a
 start and end date and the third form to select the data rows to show
 on a graph.

 When the user changes the month or year on either calendar, the
 calendar reloads and shows the selected month/year (hence the need for
 one form for each calendar).

 After the user sets the start and end dates and chooses what to plot,
 he will click the submit button.

 What's supposed to happen is for a js function to post all information
 from the 3 forms to a php file and show the result.

 I'm using this to post:

 var destiny;

 function ajaxLoad(url, formID, dest){
         destiny = dest;
         var MyAjax = new Ajax.Request(url, {
                 method:       'post',
                 parameters:   $(formID).serialize(true),
                 onComplete:   showResponse
         });

 }

 function showResponse(position){
         $(destiny).innerHTML = position.responseText;

 }

 Seeing it's not possible to use nested forms, I need to combine the
 information of all 3 and send it as parameters.

Are there same-named form controls in those forms?

--
kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---