views:

328

answers:

2

Hi Everyone,

I am working on using prototype to submit a simple login form:

http://huddlee.homeip.net/danny/

For some reason, whenever I try using the serialize function of the form it says it cannot find the function even though the prototype library is clearly being loaded.

So this function:

<script type="text/javascript">
alert($('login').serialize());
</script>

gives me this error:

$("login").serialize is not a function.

Any ideas? Thanks so much!

+2  A: 

You have the body tag with id = "login", that's the problem.

Remember id's must be unique...

Try to validate your pages...

Line 25, Column 14: ID "login" already defined

<form id="login" action="#" onsubmit="login(); return false;">
CMS
Exactly right answer
omoto
wow, I cant believe I missed that. Thanks so much!
Daniel Hertz
You're welcome!
CMS
A: 

great answer! helped a lot

mrcls