I am having my sign in and registration form both in the same page. I have specified two different routes for posting the data but it saves sign-in form inputs (which are none) when I hit the register button at the end of the registration form? I looked at this question(Multiple forms and one processing page). How would it work with node, would that means I have to create a module for different forms?
Here is my code. I have a small script at the end also because the slider function of my bootstrap template was clashing with the submit function.
<h2>Register<h2>
<form method="POST" action="/samples">
<input type="text" name="fullName" id="fullName" class="input-lg " placeholder="your full name" data-required="true">
<input type="text" name="age" id="age" class="input-lg" placeholder="age">
<input type="text" name="city" id="city" class="input-lg" placeholder="Your City">
<input type="text" name="job" class="input-lg" placeholder="Your Job">
<input type="text" name="username" class="input-lg " placeholder="prefered username" data-required="true">
<input type="password" name="password" class="input-lg" placeholder="Password">
<input type="email" name="email" class="input-lg " placeholder="your email" data-required="true">
<button type="submit" class="btn btn-primary">Sign in</button>
</form>
<h2>Login!</h2>
<form method="POST" action="/dashboard">
<hr class="colorgraph">
<input type="email" name="emaillog" class="input-lg " placeholder="your email" data-required="true">
<input type="password" name="passwordlog" class="input-lg" placeholder="Password">
<button type="submit" class="btn btn-primary">Sign in</button>
</form>
<script>
$('button').click( function() {
$('form').submit();
});
</script>
Thanks for your help