jquery dialog获取焦点的方法

发布时间:2017-03-14 13:53:05 编辑:站点网

本文实例讲述了jquery dialog获取焦点的方法。分享给大家供大家参考,具体如下:

$(document).ready(function () {
   //初始化新增申请对话框
   $("#addBusinessTrip").dialog({
     open: function (event, ui) {
       $(':input', '#addBusinessTripForm').not(':button, :submit, :reset, :hidden').val('');
       $("#addBusinessTripForm").validationEngine({
         inlineValidation: false,
         success: false,
         failure: function () {
           callFailFunction();
         }
       });
     },
     focus: function (event, ui) {
       comsole.log("dsfhsdj");
       $("#carOrNot").focus();//修改焦点
     },
     close: function (event, ui) {
       //清空提示信息
       $('#addBusinessTripForm').validationEngine('hideAll');
     },
     autoOpen: false,
     width: 480,
     modal: true,
     buttons: {
       "确定": function () {
         var valid = $('#addBusinessTripForm').validationEngine('validate');
         if (valid == true) {
           newOrEditAjax();
         } else {
           //alert("验证失败!!");
         }
       },
       "取消": function () {
         $(':input', '#addBusinessTripForm').not(':button, :submit, :reset, :hidden').val('').removeAttr('checked').removeAttr('selected');
         $(this).dialog("close");
       }
     }
   });
 });

                
更多相关内容:
    无相关信息
[!--temp.cy--]