the .reset method clears my text fields but leaves the select lists in their current state. Even worse, if the form is posted again, those select lists option value won''t even be in the parameter hash. How can I get the selects to return to their default state (without reloading the url)? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Mar 21, 3:21 pm, "jko170" <jko...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> the .reset method clears my text fields but leaves the select lists in > their current state. Even worse, if the form is posted again, those > select lists option value won''t even be in the parameter hash. How can > I get the selects to return to their default state (without reloading > the url)?Which reset method? Prototype.js''s Form.reset method just wraps the form''s reset method: var Form = { reset: function(form) { $(form).reset(); return form; }, Try: $(''formID'').reset(); which uses the form''s buit-in method. -- Rob --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''m using rjs in my create method: page.form.reset ''my_form'' I''ve also tried page[:my_form].reset which also does not work. Should I be putting the method elsewhere? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Okay, in Firefox it resets the select box just as intended. But in Safari it does nothing to the select box. Is this a known bug and is there a workaround? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Have you done anything to disable the auto-fill behavior? Maybe Safari is being "helpful" here. What happens if you do the more drastic reload()? Walter On Mar 21, 2007, at 4:28 PM, jko170 wrote:> > Okay, in Firefox it resets the select box just as intended. But in > Safari it does nothing to the select box. Is this a known bug and is > there a workaround? > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Yes, I have disabled the auto-fill behavior only for my amount/price field using :autocomplete => false I''m not at my dev comp right now but if I remove the autocomplete and the reset works for the select box, how would I get both features to work? I have read on another post that''s its sort of a preference thing to have autocomplete turned off with javascript, some say the user should do it with their browser. It is rather annoying though if you type in $5 and $500 fills in. Thanks for the reply! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Mar 22, 6:28 am, "jko170" <jko...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Okay, in Firefox it resets the select box just as intended. But in > Safari it does nothing to the select box. Is this a known bug and is > there a workaround?If no option has the selected attribute set, Safari doesn''t reset the options. Set the selected attribute for the option you want to be the default selected (usually the first one) in the HTML source or however you create the options: <select ... > <option selected ... > <option ... > ... You are supposed to do that anyway, but no one ever does. <URL: http://www.w3.org/TR/html4/interact/forms.html#idx-menu-2 > "If no OPTION element has the selected attribute set, user agent behavior for choosing which option is initially selected is undefined. Note. Since existing implementations handle this case differently, the current specification differs from RFC 1866 ([RFC1866] section 8.1.3), which states: "The initial state has the first option selected, unless a SELECTED attribute is present on any of the <OPTION> elements. "Since user agent behavior differs, authors should ensure that each menu includes a default pre-selected OPTION." -- Rob --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Perfect! Thanks alot Rob. And for any future readers I meant :autocomplete => :off rather than :autocomplete => false from my post above. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---