Herve.Thouzard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-May-11 10:04 UTC
Autocompleter running with Prototype 1.5.0 but not with 1.5.1
Hello, I have a form where the end user can type a name. This is linked to an Autocompleter. with Prototype 1.5.0 it''s runing perfectly but with Prototype 1.5.1 I have the following error message (from Firebug): too much recursion http://localhost/xoops3/modules/mykart/js/prototype.js Line 1288 if (!element || !element.tagName || element.nodeType == 3 || In my form I have 3 fields. The first field is used to type a pilote''s name and it is linked to an auto updater. The two others fields are the pilote''s surname and ID. They must be filled, automatically, by the callback function I have wrote to replace the default''s scriptaculous function used to fill the field. In summary, you type a name, the script suggest you a list of names and when you select a name, the 3 fields have to be filled by the script. Here is the page''s source code : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> <meta http-equiv="content-language" content="fr" /> <meta name="robots" content="index,follow" /> <title>Recherche d''un pilote</title> <link rel="stylesheet" type="text/css" media="screen" href="http:// localhost/xoops3/xoops.css" /> <script type="text/javascript" src="http://localhost/xoops3/modules/ mykart/js/prototype.js"> </script><script type="text/javascript" src="http://localhost/xoops3/ modules/mykart/js/scriptaculous.js"> </script><script type="text/javascript" src="http://localhost/xoops3/ include/xoops.js"></script> </head> <body> <h2>Recherche d''un pilote</h2> <br /> <form method="post" action="rechpilote.php" name="frmsearch" id="frmsearch"> <table border="0"> <tr> <td>Entrez son nom</td> <td><input type="text" name="pilote_nom" id="pilote_nom" value="" /><div id="suggestions" class="autocomplete"></div></td></tr> <tr> <td>Prénom trouvé</td> <td><input type="text" disabled=''disabled'' name="pilote_prenom" id="pilote_prenom" value="" /></td> </tr> <tr> <td>Identifiant</td> <td><input type="text" disabled=''disabled'' name="pilote_id" id="pilote_id" value="" /></td> </tr> </table> <script type="text/javascript"> function FermeMoi() { var id = document.frmsearch.pilote_id.value; var nom = document.frmsearch.pilote_nom.value; var prenom = document.frmsearch.pilote_prenom.value; window.opener.document.frmsaisepreuve.pilote_id0.value = id; window.opener.document.frmsaisepreuve.pilote_nom0.value = nom; window.opener.document.frmsaisepreuve.pilote_prenom0.value prenom; window.close(); } function hookNom(selection) { var mData = selection.innerHTML.split(''<div class="informal">''); var extrait = mData[1].split(''</div>''); var infos = extrait[0].split(''-''); var pilote_id = infos[0]; var pilote_nom = infos[1]; var pilote_prenom = infos[2]; document.frmsearch.pilote_id.value = pilote_id; document.frmsearch.pilote_nom.value = pilote_nom; document.frmsearch.pilote_prenom.value = pilote_prenom; } function initAutocompleter() { new Ajax.Autocompleter(''pilote_nom'', ''suggestions'', ''ajpilotes2.php'', {method: ''post'', paramName: ''pilote_nom'', select: ''libName'', updateElement: hookNom}); } Event.observe(window, ''load'', initAutocompleter); </script> </form> <br /><div align="center"><a href="#" onclick="FermeMoi();">Valider et fermer la fenêtre</a></div> <br /><br /><b>Note : Si vous ne trouvez pas le pilote, fermez cette fenêtre et rentrez son nom et son prénom dans la fenêtre qui a appelé cette autre fenêtre afin de le créer.</b> </body> </html> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Herve.Thouzard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-May-12 09:19 UTC
Re: Autocompleter running with Prototype 1.5.0 but not with 1.5.1
Hello, any idea ? Bye, Hervé --~--~---------~--~----~------------~-------~--~----~ 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
2007-May-12 09:20 UTC
Re: Autocompleter running with Prototype 1.5.0 but not with 1.5.1
Are you using the latest script.aculo.us? Proto 1.5.1 changed a few things, so Scripty adapted... -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: 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 -~----------~----~----~----~------~----~------~--~---
Using the Ajax.inPlaceCollection Editor, I have noticed that for some reason if the string of choices gets large the object seems to put in carriage returns that break the functionality. Has anyone else seen this? Deco --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---