I'm using the AJAX subscription code from here:
Subscribers are successfully added to my subscriber list; however the form always loads the external confirmation page instead of just loading a confirmation div, which I find ugly.
Here's a site featuring the form in a sidebar on the right:
Here's the form code:
<!-- start form --> <div id="theForm" style="padding-top:25px;"> <form action="http://enews.chillichocolate.net/t/r/s/gjktu/" method="post" id="subForm"> <div> <input type="text" name="cm-name" id="name" value="Name" size="15" style="border: 1px solid #d9d9d9;" /> <input type="text" name="cm-gjktu-gjktu" id="gjktu-gjktu" value="Email address" size="15" style="border: 1px solid #d9d9d9;" /> <input type="submit" value="Go!" style="border: 1px solid #d9d9d9;" /> </div> </form> </div> <div id="confirmation" style="display: none; font-size:11px;padding-top:24px;">Thanks for subscribing!</div> <!-- end form -->
Any ideas? Anyone testing can feel free to subscribe as many times as he likes with a @example.com address.
The Firebug console comes up with this error: "$("#subForm input:submit") is null"
and add to the submit input field id="cm-submit"
Thanks for chipping in Joomailer. I've made two changes you suggest but unfortunately the problem remains.
1) Line 16 you are loading jquery
2) Line 67 you are loading jquery again
3) Line 121 you are loading prototype
In my experience, trying to load jquery and prototype on the same page always causes issues (There are work-arounds, but I've never had much success with them).
Hope that helps,
Sorry to have left this unresolved for a couple of weeks - real life, etc etc.
I did some experimentation following Dave's post above and the culprit was indeed a clash with prototype, being loaded by another plugin. When I killed that the subscribe form began working correctly (and prettily).
Thanks guys - really appreciate the help.