scarhand Posted October 23, 2009 Share Posted October 23, 2009 this works fine: <form method="post" action="<?php bloginfo('url'); ?>/client-login"> but this does not: <form method="post" action="<?php bloginfo('url'); ?>/client-login" onsubmit="return cllogin();"> if i add the onsubmit javascript it takes me to a 404 page after posting. heres the js function: function clregister() { var errors = ""; if (document.getElementById('name').value == '') errors += "- You must enter your name\n"; if (document.getElementById('emailr').value == '') errors += "- You must enter your email\n"; if (document.getElementById('passwordr').value == '') errors += "- You must enter your password\n"; if (document.getElementById('phone').value == '') errors += "- You must enter your phone number\n"; if (document.getElementById('address').value == '') errors += "- You must enter your address\n"; if (document.getElementById('postcode').value == '') errors += "- You must enter your postcode\n"; if (document.getElementById('agree').checked == false) errors += "- You must tick the box to agree to our TOS\n"; if (errors == '') { return true; } else { errors = "The following errors have occurred:\n\n" + errors + "\nPlease fill in these boxes and try registering in again."; alert(errors); return false; } } this doesnt make any sense. Quote Link to comment Share on other sites More sharing options...
seanlim Posted October 27, 2009 Share Posted October 27, 2009 why does your onsubmit event call "cllogin()"? isn't your function named clregister? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.