Does anyone have a complete code example for the jqTransformReset() for the jqtransform form? My ultimate goal is to add a reset button to the form and reset all form fields (especially checkboxes which I can't get to reset). Thanks in advance!
问问题
1741 次
2 回答
1
每当我打电话给 document.form.reset() 我也会打电话
$(".jqTransformCheckbox").each(function(){ if($(this).hasClass('jqTransformChecked')) $(this).removeClass('jqTransformChecked');});
似乎工作正常。
于 2011-04-12T18:49:16.390 回答
1
jqTransform 不会为我或复选框重置选择框,所以我编写了这段代码,它似乎运行良好。(我使用了nando的复选框代码,谢谢nando)
$('.jqTransformButton[type="reset"]').click(function(){
$(".jqTransformCheckbox").each(function(){
if($(this).hasClass('jqTransformChecked')) {
$(this).removeClass('jqTransformChecked');
}
});
$('.jqTransform select').each(function(){
var firstOpt = $(this).find('option:first-child');
var firstVal = firstOpt.val();
firstOpt.attr("selected", "selected");
$(this).siblings('div').find('span').text(firstVal);
$(this).siblings('ul').find('a.selected').removeClass('selected');
$(this).siblings('ul').find('li:first-child a').addClass('selected');
})
})
于 2012-09-13T02:03:18.733 回答