EasyUI Forum
September 16, 2025, 11:44:03 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: ComboBox Extend Validation Dont Work In IE [Resolved]  (Read 9167 times)
zlyc
Newbie
*
Posts: 2


View Profile Email
« on: February 10, 2015, 01:36:13 AM »

Hi,

  I have manual validation piece of code working in chrome/firefox but not in IE. The code suppose to show "The entered value does not exists." if non of the value type in combobox is part of the combobox list.

   How can make it workable in IE (error msg : cbbank is undefined, File: eval code (47), Line: 1, Column: 1)

              // JavaScript
      $.extend($.fn.validatebox.defaults.rules,{
          exists:{
              validator:function(value,param) {
                  var cc = $(param[0]);
                  var v = cc.combobox('getValue');
                  var rows = cc.combobox('getData');
                  
                  for(var i=0; i<rows.length; i++) {
                      if (rows.bankName == v){return true}
                  }
                  return false;
              },
              message:'The entered value does not exists.'
          }
      });
                // HTML
         <input id="cbbank" name="bank" class="easyui-combobox" style="width: 350px;" value="${sp.bankName }"
               data-options="valueField:'bankName',
                         textField:'bankName',
                    validType: 'exists[cbbank]',                                                              
               url:'${createLink(controller:'serviceProviders', action:'bankList')}',
               mode:'remote',
               editable:true" />   
Thanks
« Last Edit: February 10, 2015, 07:56:52 PM by zlyc » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: February 10, 2015, 07:57:31 AM »

Please try to use the code below instead.
Code:
<input id="cbbank" name="bank" class="easyui-combobox" style="..."
data-options="
validType:'exists[\'#cbbank\']',
...
">
Logged
zlyc
Newbie
*
Posts: 2


View Profile Email
« Reply #2 on: February 10, 2015, 07:56:25 PM »

Work like charm!. Thanks.  Smiley
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!