I use Ajax.InPlaceEditor. When I click the field in IE it displays a input textfield. When I click it in Firefox, FF displays a textarea for editing. I would like to have FF also displays an input instead of a textarea. Anyone knows how to solve this? [code] new Ajax.InPlaceEditor(''<? echo $r[id]; ?>'', ''EipProcess.php? action=eipfav&id=<? echo $r[id]; ?>'', {size: 40,okText:''Save'',cancelText:''Discard'',clickToEditText:''Click to edit this url'', savingText:''Saving...'',highlightcolor:''#4997BE'',highlightendcolor:'''',rows:''1'',size:''60''}); [/code] Gr. Joran --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2008-Feb-27 08:34 UTC
Re: Ajax.InPlaceEditor Firefox displays textarea instead of input
Joran a écrit :> I use Ajax.InPlaceEditor. When I click the field in IE it displays a > input textfield. > When I click it in Firefox, FF displays a textarea for editing. > > I would like to have FF also displays an input instead of a textarea.It is odd indeed that you should get a different behavior in IE and FF. Are you sure you''re using the latest version of script.aculo.us? The editor field creation is governed by the internal _createEditField_ method, which will only go <input> if: 1. the _options_ rows is less than or equal to 1 (its default) *and* 2. the control''s text (as returned by the _getText_ method, which just uses _innerHTML_) does *not* contain any line break or newline characters. That behavior was deemed reasonable and appropriate to all cases. You can force a <textarea> by going with a value higher than 1 for the _rows_ option, but you can''t force a <input>, the rationale being that single-line-editing a multiple-line value is impractical, sometimes infeasible, and always misleading for the end user. ''HTH -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Joran
2008-Feb-27 09:38 UTC
Re: Ajax.InPlaceEditor Firefox displays textarea instead of input
Thanks for the explanation Christophe,> It is odd indeed that you should get a different behavior in IE and FF. > Are you sure you''re using the latest version of script.aculo.us?Yes 1.8.1> > The editor field creation is governed by the internal _createEditField_ > method, which will only go <input> if: > > 1. the _options_ rows is less than or equal to 1 (its default) *and*correct, I have the ",rows:''1''," in the code.> 2. the control''s text (as returned by the _getText_ method, which just > uses _innerHTML_) does *not* contain any line break or newline > characters.When I click the field in FF(or Opera) and the textarea appears, it starts with an line break. So that should be te problem. Next question; why is the line break there? I tried to trim the (database)value; and replaced the dbvalue with a hardcoded value. No success. Any ideas?> > That behavior was deemed reasonable and appropriate to all cases. You > can force a <textarea> by going with a value higher than 1 for the > _rows_ option, but you can''t force a <input>, the rationale being that > single-line-editing a multiple-line value is impractical, sometimes > infeasible, and always misleading for the end user. > > ''HTH > > -- > Christophe Porteneuve aka TDD > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
T.J. Crowder
2008-Feb-27 09:49 UTC
Re: Ajax.InPlaceEditor Firefox displays textarea instead of input
Joran, can you copy-and-paste a small bit of the code for where you''re producing the HTML that contains the element that you''re using the in place editor on? We might spot something. It''s easy to slip a linebreak in without realizing it, maybe there''s one that IE ignores but FF doesn''t... -- T.J. Crowder tj / crowder software / com On Feb 27, 9:38 am, Joran <joranmeijer...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks for the explanation Christophe, > > > It is odd indeed that you should get a different behavior in IE and FF. > > Are you sure you''re using the latest version of script.aculo.us? > > Yes 1.8.1 > > > > > The editor field creation is governed by the internal _createEditField_ > > method, which will only go <input> if: > > > 1. the _options_ rows is less than or equal to 1 (its default) *and* > > correct, I have the ",rows:''1''," in the code. > > > 2. the control''s text (as returned by the _getText_ method, which just > > uses _innerHTML_) does *not* contain any line break or newline > > characters. > > When I click the field in FF(or Opera) and the textarea appears, it > starts with an line break. > So that should be te problem. Next question; why is the line break > there? > I tried to trim the (database)value; and replaced the dbvalue with a > hardcoded value. > No success. > > Any ideas? > > > > > That behavior was deemed reasonable and appropriate to all cases. You > > can force a <textarea> by going with a value higher than 1 for the > > _rows_ option, but you can''t force a <input>, the rationale being that > > single-line-editing a multiple-line value is impractical, sometimes > > infeasible, and always misleading for the end user. > > > ''HTH > > > -- > > Christophe Porteneuve aka TDD > > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Joran
2008-Feb-27 10:08 UTC
Re: Ajax.InPlaceEditor Firefox displays textarea instead of input
Thanks in advance Calling a PHP function: [code] function EditColl($idcoll) { $query = "SELECT id, id_fav, url from favs where id_fav=$idcoll order by id"; $result = mysql_query($query) or die ("SELECT urls"); while ($r = mysql_fetch_array($result)) { ?> <p id="prow"> <a href=# onClick="new Ajax.Updater(''CollList'',''EipProcess.php'', {parameters:{action:''DeleteUrl'',id:''<?echo $r[id];?>''},evalScripts:true});"><font color="Red"><b>X</b></font></a><span id="<? echo $r[id]; ?>"> <?echo trim(substr($r[url],0,100));?></span></p> <script type="text/javascript"> new Ajax.InPlaceEditor(''<? echo $r[id]; ?>'', ''EipProcess.php? action=eipfav&id=<? echo $r[id]; ?>'', {size: 40,okText:''Save'',cancelText:''Discard'',clickToEditText:''Click to edit this url'', savingText:''Saving...'',highlightcolor:''#4997BE'',highlightendcolor:'''',rows:''1'',size:''60''}); </script> <? } } [/code] On 27 feb, 10:49, "T.J. Crowder" <tjcrow...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Joran, can you copy-and-paste a small bit of the code for where you''re > producing the HTML that contains the element that you''re using the in > place editor on? We might spot something. It''s easy to slip a > linebreak in without realizing it, maybe there''s one that IE ignores > but FF doesn''t... > -- > T.J. Crowder > tj / crowder software / com > > On Feb 27, 9:38 am, Joran <joranmeijer...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Thanks for the explanation Christophe, > > > > It is odd indeed that you should get a different behavior in IE and FF. > > > Are you sure you''re using the latest version of script.aculo.us? > > > Yes 1.8.1 > > > > The editor field creation is governed by the internal _createEditField_ > > > method, which will only go <input> if: > > > > 1. the _options_ rows is less than or equal to 1 (its default) *and* > > > correct, I have the ",rows:''1''," in the code. > > > > 2. the control''s text (as returned by the _getText_ method, which just > > > uses _innerHTML_) does *not* contain any line break or newline > > > characters. > > > When I click the field in FF(or Opera) and the textarea appears, it > > starts with an line break. > > So that should be te problem. Next question; why is the line break > > there? > > I tried to trim the (database)value; and replaced the dbvalue with a > > hardcoded value. > > No success. > > > Any ideas? > > > > That behavior was deemed reasonable and appropriate to all cases. You > > > can force a <textarea> by going with a value higher than 1 for the > > > _rows_ option, but you can''t force a <input>, the rationale being that > > > single-line-editing a multiple-line value is impractical, sometimes > > > infeasible, and always misleading for the end user. > > > > ''HTH > > > > -- > > > Christophe Porteneuve aka TDD > > > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2008-Feb-27 10:23 UTC
Re: Ajax.InPlaceEditor Firefox displays textarea instead of input
Your <span> starts with a line break. It doesn''t *render* in HTML (it''s just a whitespace being rendered horizontally, if any), but it''s in _innerHTML_. Start your "<?php echo" right after "<span id=...>", on the same line. -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Joran
2008-Feb-27 10:28 UTC
Re: Ajax.InPlaceEditor Firefox displays textarea instead of input
That''s it. Thank you very much. Difference in browserhandling is, in my opinion, the most confusing thing in webprogramming. Thanks again T.J. and Christophe! Gr. Joran On 27 feb, 11:23, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Your <span> starts with a line break. It doesn''t *render* in HTML (it''s > just a whitespace being rendered horizontally, if any), but it''s in > _innerHTML_. Start your "<?php echo" right after "<span id=...>", on > the same line. > > -- > Christophe Porteneuve aka TDD > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2008-Feb-27 11:30 UTC
Re: Ajax.InPlaceEditor Firefox displays textarea instead of input
Joran a écrit :> That''s it. > Thank you very much. > > Difference in browserhandling is, in my opinion, the most confusing > thing in webprogramming.Yup. That''s why we would love to be able to serve our pages as XML MIME types to have consistent whitespace handling, for instance… -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---