Hello, I have just subscribed to the list. I am having problems with the Ajax.InPlaceEditor. I am getting different results when I use Firefox and IE. The problem is: On IE, when I click submit in the InPlaceEditor form, the form posts to itself (my InPlaceEditor code is on /test/index.html, and the form posts to /test/index.html) and passes a paramater of ''value'' which contains the correctly edited text from the form...... Yet: On Firefox, when I do the exact same thing the form posts to the correct URL that I specify in the code, yet it does NOT pass the paramater of ''value'' nor its value... In fact it passes NO paramaters to the URL I specify, it just hits the URL.... So... On IE I get the value, but its not posted to the URL I specify(/secure/updateContent.cgi?....) And... On Firefox it posts to the correct URL, but I dont get the value.... Heres my code: <span id="edit $title" style="text-decoration: none;background-color:#36475E;">$title</span> <a id="edit $title control" href="#'' onClick="return false;" style="color:orange;">Edit</a> <script language="JavaScript"> new Ajax.InPlaceEditor("edit $title", "/secure/updateContent.cgi?edittitle=$esctitle", {externalControl:"edit $title control"}); </script> I have this code wrapped up in a loop inside a perl module... As you can see I have played around with passing variables directly thru the URL... But unfortunatly the content which I pass thru this way is the UNedited content, not the EDITED content which the form should be posting.... I hope this all makes sense... Hopefully I am just overlooking something or not properly using the InPlaceEditor function... I also looked around in the list archive but could not find an answer to my problem... If anyone needs more information, clarification, explanation, etc. please dont hesitate to let me know!!! Thanks, Erik erik@1bci.com
You are right! There is a bug in both IE and Safari (works only on Firefox) which makes the form post and refresh the entire page. I''m not sure how to fix it though, so all you clever JavaScript gurus out there should have a go at it. I''m returning ''false'' from the onsubmit handler function which seems to work in Firefox but IE and Safari ignores it. Could it be a case of just doing ''event.stop();''? Cheers, Jon On 9/2/05, erik@1bci.com <erik@1bci.com> wrote:> Hello, > I have just subscribed to the list. I am having problems with the > Ajax.InPlaceEditor. I am getting different results when I use Firefox > and IE. > > The problem is: On IE, when I click submit in the InPlaceEditor form, > the form posts to itself (my InPlaceEditor code is on /test/index.html, > and the form posts to /test/index.html) and passes a paramater of > ''value'' which contains the correctly edited text from the form...... > > Yet: On Firefox, when I do the exact same thing the form posts to the > correct URL that I specify in the code, yet it does NOT pass the > paramater of ''value'' nor its value... In fact it passes NO paramaters to > the URL I specify, it just hits the URL.... > > So... On IE I get the value, but its not posted to the URL I > specify(/secure/updateContent.cgi?....) > And... On Firefox it posts to the correct URL, but I dont get the value.... > > > Heres my code: > <span id="edit $title" style="text-decoration: > none;background-color:#36475E;">$title</span> > > <a id="edit $title control" href="#'' onClick="return false;" > style="color:orange;">Edit</a> > > <script > language="JavaScript"> > > new Ajax.InPlaceEditor("edit $title", > "/secure/updateContent.cgi?edittitle=$esctitle", {externalControl:"edit > $title control"}); > </script> > > > I have this code wrapped up in a loop inside a perl module... As you can > see I have played around with passing variables directly thru the URL... > But unfortunatly the content which I pass thru this way is the UNedited > content, not the EDITED content which the form should be posting.... > > I hope this all makes sense... Hopefully I am just overlooking something > or not properly using the InPlaceEditor function... I also looked around > in the list archive but could not find an answer to my problem... If > anyone needs more information, clarification, explanation, etc. please > dont hesitate to let me know!!! > > Thanks, > > Erik > erik@1bci.com > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
On 04/09/05, Jon Tirsen <jon@tirsen.com> wrote:> You are right! There is a bug in both IE and Safari (works only on > Firefox) which makes the form post and refresh the entire page. I''m > not sure how to fix it though, so all you clever JavaScript gurus out > there should have a go at it. I''m returning ''false'' from the onsubmit > handler function which seems to work in Firefox but IE and Safari > ignores it. Could it be a case of just doing ''event.stop();''? >I haven''t tested in IE, but `Event.stop(evt);` works well for me in Safari2. Cheers, Rob
Hmmm I think it might have something to do with your cgi, I have done this in php and it works in firefox and IE both. -----Original Message----- From: rails-spinoffs-bounces@lists.rubyonrails.org [mailto:rails-spinoffs-bounces@lists.rubyonrails.org] On Behalf Of Jon Tirsen Sent: Saturday, September 03, 2005 8:16 PM To: rails-spinoffs@lists.rubyonrails.org Subject: Re: [Rails-spinoffs] Ajax.InPlaceEditor You are right! There is a bug in both IE and Safari (works only on Firefox) which makes the form post and refresh the entire page. I''m not sure how to fix it though, so all you clever JavaScript gurus out there should have a go at it. I''m returning ''false'' from the onsubmit handler function which seems to work in Firefox but IE and Safari ignores it. Could it be a case of just doing ''event.stop();''? Cheers, Jon On 9/2/05, erik@1bci.com <erik@1bci.com> wrote:> Hello, > I have just subscribed to the list. I am having problems with the > Ajax.InPlaceEditor. I am getting different results when I use Firefox > and IE. > > The problem is: On IE, when I click submit in the InPlaceEditor form, > the form posts to itself (my InPlaceEditor code is on /test/index.html, > and the form posts to /test/index.html) and passes a paramater of > ''value'' which contains the correctly edited text from the form...... > > Yet: On Firefox, when I do the exact same thing the form posts to the > correct URL that I specify in the code, yet it does NOT pass the > paramater of ''value'' nor its value... In fact it passes NO paramaters to > the URL I specify, it just hits the URL.... > > So... On IE I get the value, but its not posted to the URL I > specify(/secure/updateContent.cgi?....) > And... On Firefox it posts to the correct URL, but I dont get thevalue....> > > Heres my code: > <span id="edit $title" style="text-decoration: > none;background-color:#36475E;">$title</span> > > <a id="edit $title control" href="#'' onClick="return false;" > style="color:orange;">Edit</a> > > <script > language="JavaScript"> > > new Ajax.InPlaceEditor("edit $title", > "/secure/updateContent.cgi?edittitle=$esctitle", {externalControl:"edit > $title control"}); > </script> > > > I have this code wrapped up in a loop inside a perl module... As you can > see I have played around with passing variables directly thru the URL... > But unfortunatly the content which I pass thru this way is the UNedited > content, not the EDITED content which the form should be posting.... > > I hope this all makes sense... Hopefully I am just overlooking something > or not properly using the InPlaceEditor function... I also looked around > in the list archive but could not find an answer to my problem... If > anyone needs more information, clarification, explanation, etc. please > dont hesitate to let me know!!! > > Thanks, > > Erik > erik@1bci.com > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs