Bootstrap 2.3.2 form validation

I am trying to validation my below form but its not working I have added bootstrap Validation Script in my page and gave the reference in input (data-validation-required-message=“Please Enter Subject” required=“”),
but its not working, the error message should show below the text box…

here my code:

<!DOCTYPE html>
<html lang="en">
<head>

<link href="css/bootstrap.css" type="text/css" rel="stylesheet">
<link href="css/custom-style.css" type="text/css" rel="stylesheet">
</head>
<body>

<div>
	<form action="" id="contact-form" class="form-horizontal">
	  <fieldset>
		<legend>Sample Contact Form <small>(will not submit any information)</small></legend>

		<div class="control-group">
		  <label class="control-label" for="name">Your Name</label>
		  <div class="controls">
			<input type="text" data-validation-required-message="Please Enter Name" required="" class="input-xlarge" name="name" id="name">
			<div class="help-block"></div>
		  </div>
		</div>
		<div class="control-group">
		  <label class="control-label" for="email">Email Address</label>
		  <div class="controls">
			<input type="text" data-validation-required-message="Please Enter Email" required="" class="input-xlarge" name="email" id="email">
			<div class="help-block"></div>
		  </div>
		</div>
		<div class="control-group">
		  <label class="control-label" for="subject">Subject</label>
		  <div class="controls">
			<input type="text" data-validation-required-message="Please Enter Subject" required="" class="input-xlarge" name="subject" id="subject">
			<div class="help-block"></div>
		  </div>
		</div>
		<div class="control-group">
		  <label class="control-label" for="message">Your Message</label>
		  <div class="controls">
			<textarea data-validation-required-message="Please Enter some text" required="" class="input-xlarge" name="message" id="message" rows="3"></textarea>
			<div class="help-block"></div>
		  </div>
		</div>
		<div class="form-actions">
			<button type="submit" class="btn btn-primary btn-large">Submit</button>
			<button type="reset" class="btn">Cancel</button>
		</div>
	  </fieldset>
	</form>
</div>



<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/bootstrap.js" type="text/javascript"></script>
<script src="js/jqBootstrapValidation.js" type="text/javascript"></script>

<script type="text/javascript">
	$(document).ready(function(){

	/* Form Validation */	
	$(function () { $("input,select,textarea").not("[type=submit]").jqBootstrapValidation(); } );
		
	});
	
</script>

</body>
</html>

HI,

I think we need to see a working demo (or codepen) to debug further and also an indication of which validation plugin you are using as there are a few different ones I believe.:slight_smile:

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