Validate an URL address.
Option | Equivalent HTML attribute | Type | Description |
---|---|---|---|
message |
data-bv-uri-message |
String | The error message |
You can use type="url"
attribute to enable this validator.
<form id="urlForm" class="form-horizontal">
<div class="form-group">
<label class="col-lg-3 control-label">Your website</label>
<div class="col-lg-4">
<input type="text" class="form-control" name="website" />
</div>
</div>
</form>
<script>
$(document).ready(function() {
$('#urlForm').bootstrapValidator({
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
website: {
validators: {
uri: {
message: 'The website address is not valid'
}
}
}
}
});
});
</script>
<form id="urlForm" class="form-horizontal">
<div class="form-group">
<label class="col-lg-3 control-label">Your website</label>
<div class="col-lg-4">
<input class="form-control" name="website"
type="url" data-bv-uri-message="The website address is not valid" />
</div>
</div>
</form>
<script>
$(document).ready(function() {
$('#urlForm').bootstrapValidator({
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
}
});
});
</script>
Comments
If you want to report a bug, please submit the issue on Github. Do NOT post the issue here.
For a general question or feedback, use the form below.