152 lines
6.1 KiB
HTML
152 lines
6.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>FormValidation demo</title>
|
|
|
|
<link rel="stylesheet" href="../vendor/bootstrap/css/bootstrap.css"/>
|
|
<link rel="stylesheet" href="../dist/css/formValidation.css"/>
|
|
|
|
<script type="text/javascript" src="../vendor/jquery/jquery.min.js"></script>
|
|
<script type="text/javascript" src="../vendor/bootstrap/js/bootstrap.min.js"></script>
|
|
<script type="text/javascript" src="../dist/js/formValidation.js"></script>
|
|
<script type="text/javascript" src="../dist/js/framework/bootstrap.js"></script>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="row">
|
|
<section>
|
|
<div class="col-lg-8 col-lg-offset-2">
|
|
<div class="page-header">
|
|
<h2>Multiple elements with the same name</h2>
|
|
</div>
|
|
|
|
<form id="defaultForm" method="post" class="form-horizontal" action="target.php">
|
|
<div class="form-group">
|
|
<label class="col-lg-3 control-label">Gender</label>
|
|
<div class="col-lg-5">
|
|
<div class="radio">
|
|
<label>
|
|
<input type="radio" name="gender" value="male" /> Male
|
|
</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label>
|
|
<input type="radio" name="gender" value="female" /> Female
|
|
</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label>
|
|
<input type="radio" name="gender" value="other" /> Other
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="col-lg-3 control-label">Browser</label>
|
|
<div class="col-lg-5">
|
|
<div class="checkbox">
|
|
<label>
|
|
<input type="checkbox" name="browsers[]" value="chrome" /> Google Chrome
|
|
</label>
|
|
</div>
|
|
<div class="checkbox">
|
|
<label>
|
|
<input type="checkbox" name="browsers[]" value="firefox" /> Firefox
|
|
</label>
|
|
</div>
|
|
<div class="checkbox">
|
|
<label>
|
|
<input type="checkbox" name="browsers[]" value="ie" /> IE
|
|
</label>
|
|
</div>
|
|
<div class="checkbox">
|
|
<label>
|
|
<input type="checkbox" name="browsers[]" value="safari" /> Safari
|
|
</label>
|
|
</div>
|
|
<div class="checkbox">
|
|
<label>
|
|
<input type="checkbox" name="browsers[]" value="opera" /> Opera
|
|
</label>
|
|
</div>
|
|
<div class="checkbox">
|
|
<label>
|
|
<input type="checkbox" name="browsers[]" value="other" /> Other
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="col-lg-3 control-label">Editors</label>
|
|
<div class="col-lg-5">
|
|
<input class="form-control" type="text" name="editors[]" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-lg-offset-3 col-lg-5">
|
|
<input class="form-control" type="text" name="editors[]" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-lg-offset-3 col-lg-5">
|
|
<input class="form-control" type="text" name="editors[]" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-lg-offset-3 col-lg-5">
|
|
<input class="form-control" type="text" name="editors[]" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="col-lg-offset-3 col-lg-3">
|
|
<button type="submit" class="btn btn-primary">Submit</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
$('#defaultForm').formValidation({
|
|
icon: {
|
|
valid: 'glyphicon glyphicon-ok',
|
|
invalid: 'glyphicon glyphicon-remove',
|
|
validating: 'glyphicon glyphicon-refresh'
|
|
},
|
|
err: {
|
|
container: 'tooltip'
|
|
},
|
|
fields: {
|
|
gender: {
|
|
validators: {
|
|
notEmpty: {
|
|
message: 'The gender is required'
|
|
}
|
|
}
|
|
},
|
|
'browsers[]': {
|
|
validators: {
|
|
notEmpty: {
|
|
message: 'Please specify at least one browser you use daily for development'
|
|
}
|
|
}
|
|
},
|
|
'editors[]': {
|
|
validators: {
|
|
notEmpty: {
|
|
message: 'The editor names are required'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |