EasyUI Forum
March 04, 2024, 02:10:05 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [SOLVED] Validation required show tab  (Read 832 times)
jega
Full Member
***
Posts: 190


View Profile
« on: September 01, 2023, 09:24:30 AM »

Hi.

On validation, how can i show the tab where the required textbox is ??


Jesper
« Last Edit: September 01, 2023, 09:31:00 AM by jega » Logged
jega
Full Member
***
Posts: 190


View Profile
« Reply #1 on: September 01, 2023, 09:29:54 AM »

Ohh, just found it in another topic


$('#ff').form('submit', {
   onSubmit: function(){
      var form = $(this);
      var isValid = form.form('validate');
      if (!isValid){
         var field = form.find('.validatebox-invalid:first');
         var panels = $('#tabs').tabs('tabs');
         for(var i=0; i<panels.length; i++){
            var panel = panels;
            if (panel.has(field).length){
               var index = $('#tabs').tabs('select', i);
               setTimeout(function(){
                  field.focus();
               },0)
               break;
            }
         }
      }
      
      return isValid;
   }
})
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!