context:
I'm using NodeJS, Express, MailTransport & Bootstrap for my website, creating a contact form to send me personal email.
i've created a route /sayhi to handle the mailtransport sendMail method and redirect back to / after it
i use then a classic html form :
<form action="/sayhi" method="post" name="sendMail" id="sendMail">
with 3 input "from", "mail", and "text" that was working fine with classic html form & class like so
<form action="/sayhi" method="post" name="sendMail" id="sendMail">
<input type="text" name="from" placeholder="Who?"/>
<input type="email" name="mail" placeholder="Mail?"/>
<input type="text" name="text" placeholder="Why?"/>
<input type="submit" value="Send"/>
</form>
but when i tryied to sweet things up a little with bootstrap it no longer invoke /sayhi
<form action="/sayhi" method="post" name="sendMail" id="sendMail">
<div class="form-group">
<label for="InputName">Name</label>
<input type="text" name="from" id="InputName" aria-describedby="emailHelp" placeholder="John Appleseed" form="sendMail" class="form-control"/>
<small id="nameHelp" class="form-text text-muted">How do you define yourself ?</small>
</div>
<div class="form-group">
<label for="InputEmail">Email address</label>
<input type="email" name="mail" id="InputEmail" aria-describedby="emailHelp" placeholder="you@yourdomain.com" form="sendMail" class="form-control"/>
<small id="emailHelp" class="form-text text-muted">To contact you back !</small>
</div>
<div class="form-group">
<label for="Textarea">Something to tell me ?</label>
<textarea name="text" id="Textarea" rows="3" placeholder="blah" form="sendMail" class="form-control"></textarea>
<small id="textHelp" class="form-text text-muted">It can be anything, really!</small>
</div>
<button value="Send" id="submit" type="submit" class="btn btn-primary">Submit</button>
</form>
EDIT#1 :
to add precision, i use Pug as my template engine and my form is in a special div to display it as an overlay
div.overlay
div#email_form
form(action="/sayhi" method="post" name="sendMail" id="sendMail")
div(class="form-group")
label.lettersB(for="InputName") Name
input(type="text" name="from" class="form-control" id="InputName" aria-describedby="emailHelp" placeholder="John Appleseed" form="sendMail")
small(id="nameHelp" class="form-text text-muted") How do you define yourself ?
div(class="form-group")
label.lettersB(for="InputEmail") Email address
input(type="email" name="mail" class="form-control" id="InputEmail" aria-describedby="emailHelp" placeholder="you@yourdomain.com" form="sendMail")
small(id="emailHelp" class="form-text text-muted") To contact you back !
div(class="form-group")
label.lettersB(for="Textarea") Something to tell me ?
textarea(class="form-control" name="text" id="Textarea" rows="3" placeholder="Don't let The Blank Page Syndrome Hit!" form="sendMail")
small(id="textHelp" class="form-text text-muted") It can be anything, really!
button(value="Send" class="btn btn-primary" id="submit" type="submit") Submit
EDIT#2 Problem is in my overlay class, when i take my form off it, it works fine, but i'm not sure what is causing this behavior
CSS:
.overlay {
display: none;
position:absolute;
top:0;
left:0;
right:0;
bottom:0;
background-color:rgba(0, 0, 0, 0.85);
background: url(data:;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAABl0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuNUmK/OAAAAATSURBVBhXY2RgYNgHxGAAYuwDAA78AjwwRoQYAAAAAElFTkSuQmCC) repeat scroll transparent\9;
z-index:9999;
color: white;
}
.overlay:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
}
EDIT#3 The problem seems the fact that my form is nested in another div, event with no CSS to it, just the fact that it's triggered by a button but still dont know why it behave like this