Good day, I'm trying to clear a form depends on checkbox changes
. It's working fine with the clear form
. But the probem is my checkbox isn't checked. Any solution with that ? thanks in advance and sorry for my bad english.
$(document).ready(function() {
$("#general").change(function() {
$('.form-horizontal').trigger("reset");
});
});
<script src="http://ift.tt/1oMJErh"></script>
<fieldset class="group-border">
<legend class="group-border">Form</legend>
<form class="form-horizontal" method="post">
<div class="form-group">
<label class="col-sm-3 control-label">Transaction No</label>
<div class="col-sm-6">
<input type="text" readonly required autocomplete="off" name="shippingno" id="shippingdoc" class="form-control" />
</div>
<div class="checkbox">
<label>
<input id="general" type="checkbox">General
</label>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Reference</label>
<div class="col-sm-6">
<input type="text" required autocomplete="off" name="shippingno" id="shippingdoc" class="form-control" />
</div>
<button class="btn btn-submit" id="reference" type="button">...</button>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Document No</label>
<div class="col-sm-6">
<input type="text" required autocomplete="off" name="docno" class="form-control" />
</div>
</div>
</form>
</fieldset>
Aucun commentaire:
Enregistrer un commentaire