I tried a onsubmit="return redirect()"
and onsubmit="redirect()"
where it calls a function that has a window.location.href = 'successfulSignUp.html';
inside the HTML code below in the <script>
area. No luck with it.
Tried too the same but in the <input type="submit">
field but no luck either.
I do have an action="mailto:signup@mydomain.com?Subject=User Sign Up"
inside the form because I want the user to fill the form and then open a new Mail tab to make the user send it.
I'm not looking for implementing a database, neither a php file where it sends it.
In every way, the webpage is absolutely ignoring the redirect() function I created whenever the user clicks it after the form being filled with the input criteria.
Here's my code:
<form id="signUpForm" action="mailto:signup@mydomain.com?Subject=User Sign Up" onsubmit="return redirect()" method="post" enctype="text/plain">
<input type="text" id="name" name="Name" placeholder="Name *" required>
<input type="text" id="surnames" name="Surnames" placeholder="Surnames *" required><br><br>
<input type="email" id="emailForm" name="Email" placeholder="Email">
<input type="tel" id="phoneNumber" name="Phone number" placeholder="Phone number *" required minlength="9"><br><br>
<input type="text" id="username" name="Username" placeholder="Username *" required>
<input type="password" id="password" name="Password" placeholder="Password*" required>
<p id="requiredFields"><span style="color: red">|</span> Fields marked with a * are required.</p>
<input id="registerNow" type="submit" value="Register"><br><br
</form>
An the JavaScript code I have is:
<script type="text/javascript">
function redirect(){
window.location.href = 'successfulSignUp.html';
}
</script>