Well, I start recently with Scriptacolus and inPlaceEditor. I have two doubts about use it. 1) When I specify URL for save changes or not it doesn''t work. See example below: <script type="text/javascript"> new Ajax.InPlaceEditor(''aNombre'', ''productos.php?a=actualizar&f=aNombre''); </script> In productos.php file I have this: $field = isset($_GET[''f''])?$_GET[''f'']:null; // wich means the field for update or not if ($_GET[''a''] == "actualizar") { switch ($field){ case "aNombre": die ('' You try to edit aNombre field ''); break; } } But it not works, nothing is returned for me. 2) How I can customize elements? I see in inPlaceEditor doc the sintax for this one: new Ajax.InPlaceEditor( element, url, [options]); It''s simply. My doubt is for example how to change the value for "Ok" and "Cancel" button . I try with this: new Ajax.InPlaceEditor(''aNombre'', ''productos.php?a=actualizar&f=aNombre'',''okText=Update cancelText=''Leave changes''''); But not works Best, -- ReynierPM 4to. Ing. Informática Linux User: #310201 El programador superhéroe aprende de compartir sus conocimientos. Es el referente de sus compañeros. Todo el mundo va a preguntarle y él, secretamente, lo fomenta porque es así como adquiere su legendaria sabiduría: escuchando ayudando a los demás...
Hey, I was just thinking about 1) - maybe (I did not check yet) is using the $_POST variable, since this is default I think. I usually use the $_REQUEST in PHP which takes _GET and / or _POST. See the PHP manual for more questions. 2) Your syntax is probably not correct (maybe this is the solution for 1) too). new Ajax.InPlaceEditor(''aNombre'', ''productos.php?a=actualizar&f=aNombre'', {okText:''Update'', cancelText:''Leave changes''} ); so, the third parameter is surrounded with the { brackets, the options are seperated with commas, the values have a colon, no equal. see the extended demos for more information http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor hope this helps. GNight. greetings, benni. -SDG- Reynier Perez Mira wrote:> Well, I start recently with Scriptacolus and inPlaceEditor. I have two doubts about use it. > 1) When I specify URL for save changes or not it doesn''t work. See example below: > <script type="text/javascript"> > new Ajax.InPlaceEditor(''aNombre'', ''productos.php?a=actualizar&f=aNombre''); > </script> > In productos.php file I have this: > $field = isset($_GET[''f''])?$_GET[''f'']:null; // wich means the field for update or not > if ($_GET[''a''] == "actualizar") { > switch ($field){ > case "aNombre": > die ('' You try to edit aNombre field ''); > break; > } > } > But it not works, nothing is returned for me. > 2) How I can customize elements? I see in inPlaceEditor doc the sintax for this one: > new Ajax.InPlaceEditor( element, url, [options]); > It''s simply. My doubt is for example how to change the value for "Ok" and "Cancel" button . I try with this: > new Ajax.InPlaceEditor(''aNombre'', ''productos.php?a=actualizar&f=aNombre'',''okText=Update cancelText=''Leave changes''''); > But not works > Best,
He just means that maybe $_GET is not where the variables are, maybe they are stored in $_POST instead. It''s worth trying. If you want to make sure you get them (no matter if they are in $_GET or $_POST), you can use $_REQUEST. $_REQUEST simply means: $_GET + $_POST Sorry I''m monolingual - I can''t help much! - Danger On 2/20/06, Reynier Perez Mira <rperezm-znaZGchgss6Fb/1eCGiHEemH8TO7WPXX@public.gmane.org> wrote:> > Hi: > I understand the second answer but the one not leave much clarify to me. > What''s mean: "I usually use the $_REQUEST in PHP which takes _GET and / or > _POST. ". I read in doc and found that $_POST is method by default but not > know where is my mistake > Best, > -- > ReynierPM > 4to. Ing. Informática > Linux User: #310201 > El programador superhéroe aprende de compartir sus conocimientos. Es el > referente de sus compañeros. Todo el mundo va a preguntarle y él, > secretamente, lo fomenta porque es así como adquiere su legendaria > sabiduría: escuchando ayudando a los demás... > > > -----Mensaje original----- > > De: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] En > > nombre de Benjamin Mack > > Enviado el: Monday, February 20, 2006 10:15 PM > > Para: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > Asunto: Re: [Rails-spinoffs] Help with Script.aculo inPlaceEditor > > > > Hey, > > > > I was just thinking about 1) - maybe (I did not check yet) is > > using the > > $_POST variable, since this is default I think. > > > > 2) Your syntax is probably not correct (maybe this is the > > solution for > > 1) too). > > > > new Ajax.InPlaceEditor(''aNombre'', > > ''productos.php?a=actualizar&f=aNombre'', {okText:''Update'', > > cancelText:''Leave changes''} ); > > > > so, the third parameter is surrounded with the { brackets, > > the options > > are seperated with commas, the values have a colon, no equal. > > > > see the extended demos for more information > > http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor > > > > hope this helps. GNight. > > > > greetings, > > benni. > > -SDG- > > > > > > Reynier Perez Mira wrote: > > > Well, I start recently with Scriptacolus and inPlaceEditor. > > I have two doubts about use it. > > > 1) When I specify URL for save changes or not it doesn''t > > work. See example below: > > > <script type="text/javascript"> > > > new Ajax.InPlaceEditor(''aNombre'', > > ''productos.php?a=actualizar&f=aNombre''); > > > </script> > > > In productos.php file I have this: > > > $field = isset($_GET[''f''])?$_GET[''f'']:null; // wich means > > the field for update or not > > > if ($_GET[''a''] == "actualizar") { > > > switch ($field){ > > > case "aNombre": > > > die ('' You try to edit aNombre field ''); > > > break; > > > } > > > } > > > But it not works, nothing is returned for me. > > > 2) How I can customize elements? I see in inPlaceEditor doc > > the sintax for this one: > > > new Ajax.InPlaceEditor( element, url, [options]); > > > It''s simply. My doubt is for example how to change the > > value for "Ok" and "Cancel" button . I try with this: > > > new Ajax.InPlaceEditor(''aNombre'', > > ''productos.php?a=actualizar&f=aNombre'',''okText=Update > > cancelText=''Leave changes''''); > > > But not works > > > Best, > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Hi: I understand the second answer but the one not leave much clarify to me. What''s mean: "I usually use the $_REQUEST in PHP which takes _GET and / or _POST. ". I read in doc and found that $_POST is method by default but not know where is my mistake Best, -- ReynierPM 4to. Ing. Informática Linux User: #310201 El programador superhéroe aprende de compartir sus conocimientos. Es el referente de sus compañeros. Todo el mundo va a preguntarle y él, secretamente, lo fomenta porque es así como adquiere su legendaria sabiduría: escuchando ayudando a los demás...> -----Mensaje original----- > De: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] En > nombre de Benjamin Mack > Enviado el: Monday, February 20, 2006 10:15 PM > Para: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Asunto: Re: [Rails-spinoffs] Help with Script.aculo inPlaceEditor > > Hey, > > I was just thinking about 1) - maybe (I did not check yet) is > using the > $_POST variable, since this is default I think. > > 2) Your syntax is probably not correct (maybe this is the > solution for > 1) too). > > new Ajax.InPlaceEditor(''aNombre'', > ''productos.php?a=actualizar&f=aNombre'', {okText:''Update'', > cancelText:''Leave changes''} ); > > so, the third parameter is surrounded with the { brackets, > the options > are seperated with commas, the values have a colon, no equal. > > see the extended demos for more information > http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor > > hope this helps. GNight. > > greetings, > benni. > -SDG- > > > Reynier Perez Mira wrote: > > Well, I start recently with Scriptacolus and inPlaceEditor. > I have two doubts about use it. > > 1) When I specify URL for save changes or not it doesn''t > work. See example below: > > <script type="text/javascript"> > > new Ajax.InPlaceEditor(''aNombre'', > ''productos.php?a=actualizar&f=aNombre''); > > </script> > > In productos.php file I have this: > > $field = isset($_GET[''f''])?$_GET[''f'']:null; // wich means > the field for update or not > > if ($_GET[''a''] == "actualizar") { > > switch ($field){ > > case "aNombre": > > die ('' You try to edit aNombre field ''); > > break; > > } > > } > > But it not works, nothing is returned for me. > > 2) How I can customize elements? I see in inPlaceEditor doc > the sintax for this one: > > new Ajax.InPlaceEditor( element, url, [options]); > > It''s simply. My doubt is for example how to change the > value for "Ok" and "Cancel" button . I try with this: > > new Ajax.InPlaceEditor(''aNombre'', > ''productos.php?a=actualizar&f=aNombre'',''okText=Update > cancelText=''Leave changes''''); > > But not works > > Best, > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
Me again, I check my code again and made some changes to it: <div id="fNombre">Some Text</div> <script type="text/javascript"> new Ajax.InPlaceEditor(''fNombre'', ''test.php?a=actualizar&f=aDescripcion'', {okText:''Save'', cancelText:''Discard'', size:25}); </script> <div id="fDescripcion">some text</div> <script type="text/javascript"> new Ajax.InPlaceEditor(''fDescripcion'', ''test.php?a=actualizar&f=aNombre'', {okText:''Save'', cancelText:''Discard'', size:25, cols:50, rows: 10}); </script> And in file test.php I have this: <? $field = isset($_REQUEST[''f''])?$_REQUEST[''f'']:null; die ( $field ); ?> So is supposed when I die ($field) this must take two options: 1) If I play with first inPlaceEditor called ''fNombre'' then the value for $field was the text typed in fNombre field. 2) If I play with second inPlaceEditor called ''fDescripcion'' then the value for $field was the text typed in fDescripcion field. But this not happen. When I do this: 1) Play with first "inPlaceEditor" called ''fNombre'' and clic in Save button then the value take is fDescripcion 2) Play with second "inPlaceEditor" called ''fDescripcion'' and clic in Save button then the value take is fNombre What''s wrong at this point ? Regards, -- ReynierPM 4to. Ing. Informática Linux User: #310201 El programador superhéroe aprende de compartir sus conocimientos. Es el referente de sus compañeros. Todo el mundo va a preguntarle y él, secretamente, lo fomenta porque es así como adquiere su legendaria sabiduría: escuchando ayudando a los demás...
On 2/20/06, Reynier Perez Mira <rperezm-znaZGchgss6Fb/1eCGiHEemH8TO7WPXX@public.gmane.org> wrote:> new Ajax.InPlaceEditor(''fNombre'', ''test.php?a=actualizar&f=aDescripcion'', {okText:''Save'', cancelText:''Discard'', size:25});#> new Ajax.InPlaceEditor(''fDescripcion'', ''test.php?a=actualizar&f=aNombre'', {okText:''Save'', cancelText:''Discard'', size:25, cols:50, rows: 10});#> But this not happen. When I do this: > 1) Play with first "inPlaceEditor" called ''fNombre'' and clic in Save button then the value take is fDescripcion > 2) Play with second "inPlaceEditor" called ''fDescripcion'' and clic in Save button then the value take is fNombreYou have the ''fNombre'' and &f=aDescripcion mixed up. Same with ''fDescripcion'' and &f=aNombre. Todd
Well I check again and the code now is this: ------------- <div id="fNombre">Some Text</div> <script type="text/javascript"> new Ajax.InPlaceEditor(''fNombre'', ''test.php?a=actualizar&f=fNombre'', {okText:''Salvar'', cancelText:''Cancelar'', clickToEditText:''Click para editar'', size:25, highlightcolor: ''#F5F5FF''}); </script> ------------- and test.php contains this: ------------- <? $field = isset($_REQUEST[''f''])?$_REQUEST[''f'']:null; die ( $field ); ?> ------------- The field by default have this "Some text". Now, when I edit field and put this "Some text two" is supposed that when I click in Save button (okButton) the file test.php return this: "Some text two", because I die with $_REQUEST[''f''] or not? What''s wrong? Why I can''t obtain the really edited value? Best, -- ReynierPM 4to. Ing. Informática Linux User: #310201 El programador superhéroe aprende de compartir sus conocimientos. Es el referente de sus compañeros. Todo el mundo va a preguntarle y él, secretamente, lo fomenta porque es así como adquiere su legendaria sabiduría: escuchando ayudando a los demás...> -----Mensaje original----- > De: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] En > nombre de Todd Ross > Enviado el: Tuesday, February 21, 2006 6:40 AM > Para: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Asunto: Re: [Rails-spinoffs] Help with Script.aculo inPlaceEditor > > On 2/20/06, Reynier Perez Mira <rperezm-znaZGchgss6Fb/1eCGiHEemH8TO7WPXX@public.gmane.org> wrote: > > new Ajax.InPlaceEditor(''fNombre'', > ''test.php?a=actualizar&f=aDescripcion'', {okText:''Save'', > cancelText:''Discard'', size:25}); > # > > new Ajax.InPlaceEditor(''fDescripcion'', > ''test.php?a=actualizar&f=aNombre'', {okText:''Save'', > cancelText:''Discard'', size:25, cols:50, rows: 10}); > # > > But this not happen. When I do this: > > 1) Play with first "inPlaceEditor" called ''fNombre'' and > clic in Save button then the value take is fDescripcion > > 2) Play with second "inPlaceEditor" called ''fDescripcion'' > and clic in Save button then the value take is fNombre > > You have the ''fNombre'' and &f=aDescripcion mixed up. Same with > ''fDescripcion'' and &f=aNombre. > > Todd > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >