9 Mayıs 2013, PERŞEMBE
Nasıl bir form ile jQuery kullanarak sıfırlamak için .() sıfırlama yöntemi
Ben reset düğmesine tıkladığınızda formumu reset verebilecek çalışan kod vardı. Benim kod daha uzun oluyor sonra ancak, artık bir işe yaramadığını fark ettim.
<div id="labels">
<table class="config">
<thead>
<tr>
<th colspan="4"; style= "padding-bottom: 20px; color:#6666FF; text-align:left; font-size: 1.5em">Control Buttons Configuration</th>
</tr>
<tr>
<th>Index</th>
<th>Switch</th>
<th>Response Number</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<form id="configform" name= "input" action="#" method="get">
<tr><td style="text-align: center">1</td>
<td><img src= "static/switch.png" height="100px" width="108px"></td>
<td id="small"><input style="background: white; color: black;" type="text" value="" id="number_one"></td>
<td><input style="background: white; color: black;" type="text" id="label_one"></td>
</tr>
<tr>
<td style="text-align: center">2</td>
<td><img src= "static/switch.png" height="100px" width="108px"></td>
<td id="small"><input style="background: white; color: black;" type="text" id = "number_two" value=""></td>
<td><input style="background: white; color: black;" type="text" id = "label_two"></td>
</tr>
<tr>
<td style="text-align: center">3</td>
<td><img src= "static/switch.png" height="100px" width="108px"></td>
<td id="small"><input style="background: white; color: black;" type="text" id="number_three" value=""></td>
<td><input style="background: white; color: black;" type="text" id="label_three"></td>
</tr>
<tr>
<td style="text-align: center">4</td>
<td><img src= "static/switch.png" height="100px" width="108px"></td>
<td id="small"><input style="background: white; color: black;" type="text" id="number_four" value=""></td>
<td><input style="background: white; color: black;" type="text" id="label_three"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" id="configsubmit" value="Submit"></td>
</tr>
<tr>
<td><input type="reset" id="configreset" value="Reset"></td>
</tr>
</form>
</tbody>
</table>
</div>
Ve benim bir WordPress kullanmak:
$('#configreset').click(function(){
$('#configform')[0].reset();
});
Çalışmak .reset() yöntem için benim kodları vardır ben gereken bazı kaynak var mı? Daha önce kullanıyordum:
<script src="static/jquery.min.js">
</script>
<script src="static/jquery.mobile-1.2.0.min.js">
</script>
ve .reset() yöntemi çalışıyordu.
Ben şu anda kullanıyorum
<script src="static/jquery-1.9.1.min.js"></script>
<script src="static/jquery-migrate-1.1.1.min.js"></script>
<script src="static/jquery.mobile-1.3.1.min.js"></script>
Muhtemelen nedeni olabilir mi?
CEVAP
1 Temmuz 2014, Salı
trigger kullanarak deneyebilirsiniz() Reference Link
$('#form_id').trigger("reset");
Bunu PaylaÅŸ:

Nasıl bir seçim kutusu jQuery kullanar...
Nasıl bir köprü jQuery kullanarak href...
Nasıl sadece sayısal (0-9) HTML ınputb...
Nasıl tüm CSS dersleri jQuery kullanar...
Nasıl jQuery kullanarak HTML varlıklar...