重置按钮的js写法


 

<button type="button" onclick="ClearTextBox()">重置</button>

<script>
 $("#createDateBegin").datepicker();
 $("#createDateEnd").datepicker();
 
 function ShowProjectDetail(id){
  window.showModalDialog("<s:property value='basePath'/>contacts/orgMgr!showProject?projectId="+id,null,"dialogHeight: 600px; dialogWidth: 800px;center=yes");
 }
 
 function ClearTextBox(){  
  $("#contactId").val("");
  var inputs = document.all.tags("INPUT");  
  for(var i=0; i < inputs.length; i++) {
    if (inputs[i].type == "text") {
    inputs[i].value = ""; }
   if (inputs[i].type == "checkbox") {
    inputs[i].value = null; }  
  }
    
  var inputs = document.all.tags("TEXTAREA");  
  for(var i=0; i < inputs.length; i++)  
  inputs[i].value = "";  
 }
</script>

 

===============================================================

 

$(function() {

 $("#resetBtn").button({icons : {primary : "ui-icon-tag"}});

 $("#resetBtn").click(function(){
  $(':input','#tagForm').not(':button, :submit, :reset').val('').removeAttr('checked').removeAttr('selected');
 });

});

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM