See the example below:

I guess Prototype doesn't like that the form "driving_directions" has
two inputs with the same name, which is valid HTML.

The second form is correctly serialized.

<html>
    <head>
        <script type="text/javascript"
src="/w2gi/javascript/prototype.js"></script>
        <script>
            function serialize() {
                var form = $('driving_directions');
                var str = Form.serialize(form);
                console.log(str);
                alert(str);

                var form2 = $('driving_directions2');
                var str2 = Form.serialize(form2);
                console.log(str2);
                alert(str2);
            }
        </script>
    </head>

    <body onload="serialize();">
        <form id="driving_directions">
            <input type="text" size="28" name="addressline"
value="Chicago, IL 60606"/>
            <input type="text" size="28" name="addressline"
value="Wheeling, IL 60090"/>
        </form>
        <form id="driving_directions2">
            <input type="text" size="28" name="addressline"
value="Chicago, IL 60606"/>
            <input type="text" size="28" name="addressline2"
value="Wheeling, IL 60090"/>
        </form>            
    </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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to