Bootstrap not validating with ajax

My form sends over even though the field is empty. Can someone please help me check what’s wrong?

$(document).ready(function () {
                //validation rules
                    rules: {
                        "comment": {
                            required: true,
                    //perform an AJAX post to ajax.php
                    submitHandler: function() {
                        type: "POST",
				url: "",
				data: $("#insertInquiry").serialize(),
				success: function(msg){
						$(".sentMsg").text('Message Sent');
						$(".sentMsg").text('Message Not Sent');

my view:

<form id="insertInquiry" role="form" action="" method="POST" data-toggle="validator">		
							<div class="form-group">
								<label for="Username">Questions? Send us a message...</label>
							<div class="form-group">
								<label for="comment">Inquiry:</label>
								<textarea class="form-control" rows="5" id="comment" name="patientinquiry" required></textarea>
							<button type="submit" class="btn btn-default" value="Submit">Submit</button><p class="sentMsg"></p>

Or is there any way to validate a form before sending the request in ajax?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.