How do I make a form submit then redirect?

Omega

Member
Dec 22, 2011
38
2
Hello,
I'm trying to code the register part of the cms but got stuck on the submitting part.
It submits it into the db perfectly but I want it to redirect to the index page once it's submitted.
I've tried
<form method="post" onsubmit=window.location="/index.php" action="/registeration.php" name="register" class="form">
But that didn't work, does anyone know what to do?
 

Mitchul

Sledmoresux
Feb 18, 2012
371
46
Could be wrong, but,
HTML:
<div id="messageDiv"><form>
// various shit here
<input type="submit" value="Send" onClick="register()"><input type="reset" value="Reset"name='reset'></form></div>
Code:
<script type="text/javascript">
function register(){
window.location.href ="index.php";
return false;
 
}
</script>
Try this on the register page?
 

iPod.

Member
Nov 21, 2011
91
14
</div>
<div class="field field-tos">
<input id="tos" value="accept" type="checkbox" id="password" name="bean.tos"/>I accept the Terms and Conditions</a>.
</div>
<a href=" " class="new-button" id="next-btn"><b>Create Account</b><i></i></a>
<input type="submit" id="next" value="Create account"/><a href="WEBSITE URL ">Cancel</a>
</form>
</div>
</div>

<script type="text/javascript">


Should be something like that
 

Users who are viewing this thread

Top