dossier_lookup : enter = submit
This commit is contained in:
@@ -12,29 +12,30 @@
|
||||
data-fv-icon-validating="glyphicon glyphicon-refresh">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-4" for="societe">Sociéte</label>
|
||||
<label class="col-sm-4 control-label">Société</label>
|
||||
<div class="col-xs-8">
|
||||
<select class="form-control" id="societe" name="societe">
|
||||
<div tal:repeat="item societes">
|
||||
<option value="${item}" tal:attributes="selected societe==item and 'selected' or None">${item}</option>
|
||||
</div>
|
||||
</select>
|
||||
<label class="radio-inline"><input type="radio" name="societe" value="PE"
|
||||
tal:attributes="checked societe=='PE'">PE</label>
|
||||
<label class="radio-inline"><input type="radio" name="societe" value="ME"
|
||||
tal:attributes="checked societe=='ME'">ME</label>
|
||||
<label class="radio-inline"><input type="radio" name="societe" value="PL"
|
||||
tal:attributes="checked societe=='PL'">PL</label>
|
||||
<label class="radio-inline"><input type="radio" name="societe" value="PO"
|
||||
tal:attributes="checked societe=='PO'">PO</label>
|
||||
<label class="radio-inline"><input type="radio" name="societe" value="CD"
|
||||
tal:attributes="checked societe=='CD'">CD</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">Nom ou numéro du chantier</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="name" value="${name}"
|
||||
data-fv-stringlength="true"
|
||||
data-fv-stringlength-min="2"
|
||||
data-fv-stringlength-max="30"
|
||||
data-fv-stringlength-message="Le nom ou le numéro doit avoir de 2 à 30 caractères de long" />
|
||||
<input type="text" class="form-control" name="name" value="${name}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-4 col-sm-8">
|
||||
<button class="btn btn-primary" type="submit" name="form.submitted">
|
||||
<button id="submitButton" class="btn btn-primary" type="submit" name="form.submitted">
|
||||
<span class="glyphicon glyphicon-search"></span> Rechercher</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -99,9 +100,31 @@
|
||||
});
|
||||
|
||||
});
|
||||
$('#site-search-form').formValidation();
|
||||
$('#site-search-form').formValidation({
|
||||
framework: 'bootstrap',
|
||||
message: 'This value is not valid',
|
||||
icon: {
|
||||
valid: 'glyphicon glyphicon-ok',
|
||||
invalid: 'glyphicon glyphicon-remove',
|
||||
validating: 'glyphicon glyphicon-refresh'
|
||||
},
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: 'Le nom ou le numéro doit avoir de 2 à 30 caractères de long'
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
$('form input').on('keypress', function(e) {
|
||||
return e.which !== 13;
|
||||
var code = e.keyCode || e.which;
|
||||
if (code === 13) {
|
||||
e.preventDefault();
|
||||
// simuler clic bouton submit
|
||||
document.getElementById("submitButton").click();
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user