jQuery Steps - reset wizard without page reload

前端 未结 5 2166
攒了一身酷
攒了一身酷 2021-02-15 12:05

I am using jQuery steps ( https://github.com/rstaib/jquery-steps/wiki ) in order to create step by step form to users to fill out. It works great, however I need to be able to r

5条回答
  •  余生分开走
    2021-02-15 13:00

    You can user this function after submitting your form:
    
    function resetForm(id_form){
        $("#" + id_form).find('input[type="text"]').val('');
        $("#" + id_form).find('input[type="password"]').val('');
        $("#" + id_form).find('input[type="checkbox"]').removeAttr("checked");
        $("#" + id_form).find('select option').removeAttr("selected");
        $("#" + id_form).find('textarea').val('');
    }
    
    Best regards!
    

提交回复
热议问题