Hi folks. Another Prototype question. I have a simple ajax form which I want to return results on an onChange. Works in IE6 (Win) and FF, but Safari doesn''t seem to take the onChange too well. Upon the return key, it blanks out the form. Upon tabbing to the next field (actually the next form), I get the results. <form name="form1" id="form1" action="#" method="post" onSubmit="return false;"> <input class="formentry" type="text" id="x_hotel" size="20" value="" onChange="getNames(this.form)" /> </form> I''ve tried taking out the onSubmit altogether, as well as tried onSubmit="", but neither seems to work as it just clears out the form with zero results. Any ideas? Cheers --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
BeeRich wrote:> Hi folks. Another Prototype question.I don''t think it has anything to do with Prototype, unless the issue is somewhere in getNames()> > I have a simple ajax form which I want to return results on an > onChange. Works in IE6 (Win) and FF, but Safari doesn''t seem to take > the onChange too well. Upon the return key, it blanks out the form. > Upon tabbing to the next field (actually the next form), I get the > results.The onchange event fires when the element loses focus. In Safari, cancelling submit means that the control doesn''t lose focus so onchange doesn''t fire.> > <form name="form1" id="form1" action="#" method="post" onSubmit="return > false;"> > <input class="formentry" type="text" id="x_hotel" size="20" value="" > onChange="getNames(this.form)" /> > </form>[...]> Any ideas?Try: <form ... onsubmit="return getNames(this);"> <input onchange="this.form.submit()" ... > </form> And if getNames() works, return false. If getNames fails, e.g. AJAX isn''t supported, return true and the the form will submit normally. If script is disabled, the form will submit too (but not onchange). -- 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 -~----------~----~----~----~------~----~------~--~---
Rob, she works! Thanks for the guidance. Makes sense that submitting while returning false would do the trick. Cheers --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
RobG wrote on the Prototype.js google group:> > <snip> > -- > RobAre c.l.j regulars even allowed over to this group :) Peter --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---