I am working on integrating Bootsrap forms into Kentico CMS which is powered by .NET. In doing so I noticed that the "form" tag is being stripped from my form.
I received the following from Kentico Support - I'm afraid that custom form tags are not supported in ASP.NET WebForms. The problem is that in ASP.NET the whole page is wrapped in a form tag (this is the standard .NET behavior not specific to Kentico), and the HTML standard doesn't allow nested form tags.
I have a page template built out with the error handling in HTML, I do not have any .NET programming experience. Can anyone point me to how I can get the Bootstrap forms error handling and submissions working correctly within .NET?
Thank you!
Here is the current formatting:
<form action="" method="post" id="contact_form">
<div class="col-md-12">
<div class="col-md-6 zero-margin-bottom">
<div class="form-group">
<label for="Company">Company</label>
<input name="company" type="company" class="form-control" id="exampleInputCompany" placeholder="Company">
</div>
<div class="form-group">
<label for="FirstName">First Name</label>
<input name="first_name" type="firstname" class="form-control" id="exampleInputFirstName" placeholder="First Name">
</div>
<div class="form-group">
<label for="LastName">Last Name</label>
<input name="last_name" type="lastname" class="form-control" id="exampleInputLastName" placeholder="Last Name">
</div>
</div>
<div class="col-md-6 zero-margin-bottom">
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input name="email" type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Phone</label>
<input name="phone" type="phone" class="form-control" id="exampleInputPhome" placeholder="Phone">
</div>
<div class="form-group">
<label for="country">Country</label>
<select name="country" class="form-control">
<option value="">Select Country</option>
<option value="Abu Dhabui">Abu Dhabui</option>
<option value="...">Afghanistan</option>
</select>
</div>
</div>
<div class="col-md-12 zero-margin-bottom">
<div class="form-group">
<label for="comments">Comments:</label>
<textarea name="comment" class="form-control" rows="3"></textarea>
</div>
<button type="submit" class="btn btn-default submit btn-danger">Send Request</button>
</div>
</div>
</form>
<form>
tag. If you add another form inside of your page, then the HTML standard dictates that the inner form gets stripped from the DOM, as it is illegal.