I am using JS to replace my submit buttons with A tags w/ observers. The reason for this is I want better looking buttons. When the A is clicked it does some validation, and then "clicks" the hidden submit button. When JS "clicks" the button however they name/value is not getting submitted along with the other form values in the _POST such as if a person clicked a regular submit button. Do you know how to get this to happen? As an FYI, here is the code I am using: $(form).select(''INPUT[type="submit"]'').each(function(b) { new_id = ''submit_btn_''+i; // Turning off hide so you can test the difference // input_button = b.hide(); input_button = b; input_button.insert({after: ''<a class="button_dark submit" id="''+new_id+''" href="#" onClick="this.blur();"><span>''+ input_button.value +''</span></a>''}); new_button = $(new_id); // Can''t use click, because sometimes mouseup/down does not happen on the same element, there is a span in there too. new_button.observe(''mouseup'', function(e) { e.stop(); // Do some validation if (true) input_button.click(); }); i++; }); --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, We''ve started transitioning to a new, better-named, hopefully-spam- free group for Prototype and script.aculo.us: http://groups.google.com/group/prototype-scriptaculous/ prototype-scriptaculous-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Could you please post your question there instead? Thanks! People might still answer here, but probably not for all that much longer... -- T.J. Crowder tj / crowder software / com On Jul 14, 8:49 pm, louis w <louiswa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am using JS to replace my submit buttons with A tags w/ observers. > The reason for this is I want better looking buttons. When the A is > clicked it does some validation, and then "clicks" the hidden submit > button. > > When JS "clicks" the button however they name/value is not getting > submitted along with the other form values in the _POST such as if a > person clicked a regular submit button. Do you know how to get this > to happen? > > As an FYI, here is the code I am using: > > $(form).select(''INPUT[type="submit"]'').each(function(b) { > > new_id = ''submit_btn_''+i; > > // Turning off hide so you can test the difference > // input_button = b.hide(); > input_button = b; > input_button.insert({after: ''<a class="button_dark submit" > id="''+new_id+''" href="#" onClick="this.blur();"><span>''+ > input_button.value +''</span></a>''}); > new_button = $(new_id); > > // Can''t use click, because sometimes mouseup/down does not happen on > the same element, there is a span in there too. > new_button.observe(''mouseup'', function(e) { > e.stop(); > // Do some validation > if (true) input_button.click(); > }); > > i++; > > }); > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks I will ask there. I was wondering what was up with all this spam. The name of this list makes a lot more sense too. On Jul 15, 1:36 am, "T.J. Crowder" <t...-MUGVhKWuB3Yd9SLi6J12IkEOCMrvLtNR@public.gmane.org> wrote:> Hi, > > We''ve started transitioning to a new, better-named, hopefully-spam- > free group for Prototype and script.aculo.us: > > http://groups.google.com/group/prototype-scriptaculous/ > > prototype-scriptaculous-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > Could you please post your question there instead? Thanks! People > might still answer here, but probably not for all that much longer... > -- > T.J. Crowder > tj / crowder software / com > > On Jul 14, 8:49 pm, louis w <louiswa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I am using JS to replace my submit buttons with A tags w/ observers. > > The reason for this is I want better looking buttons. When the A is > > clicked it does some validation, and then "clicks" the hidden submit > > button. > > > When JS "clicks" the button however they name/value is not getting > > submitted along with the other form values in the _POST such as if a > > person clicked a regular submit button. Do you know how to get this > > to happen? > > > As an FYI, here is the code I am using: > > > $(form).select(''INPUT[type="submit"]'').each(function(b) { > > > new_id = ''submit_btn_''+i; > > > // Turning off hide so you can test the difference > > // input_button = b.hide(); > > input_button = b; > > input_button.insert({after: ''<a class="button_dark submit" > > id="''+new_id+''" href="#" onClick="this.blur();"><span>''+ > > input_button.value +''</span></a>''}); > > new_button = $(new_id); > > > // Can''t use click, because sometimes mouseup/down does not happen on > > the same element, there is a span in there too. > > new_button.observe(''mouseup'', function(e) { > > e.stop(); > > // Do some validation > > if (true) input_button.click(); > > }); > > > i++; > > > });--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---