EasyUI Forum
November 06, 2025, 03:59:50 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: Text box validate box  (Read 11076 times)
jaimi
Full Member
***
Posts: 121


View Profile
« on: October 24, 2014, 02:55:16 AM »

Hello,

I have difficulties managing the properties of the textBox/validateBox within my formular.
For example, how to verify that the length ot a value must be exactly 64?
Can I add this to :
$('#HOM_NAME').validatebox({
  required: true,
  validType: 'length[0,64]',
  missingMessage: 'Geben Sie den Pferdenamen ein.',
  invalidMessage: 'Der Pferdename ist notwendig.',
  prompt: 'Pferdename...'
 });

Another problem ist that it doesn't show the prompt.

May anyone can give me a example/tutorial?

Thanks.
Jaimi
Logged
jarry
Administrator
Hero Member
*****
Posts: 2300


View Profile Email
« Reply #1 on: October 24, 2014, 07:41:28 AM »

You can extend a new rule to validate if a string length is exactly the given length value.
Code:
$.extend($.fn.validatebox.defaults.rules, {
len: {
validator: function(value, param){
return value.length == param[0];
},
message: 'The message length must be {0}'
}
})
Logged
jaimi
Full Member
***
Posts: 121


View Profile
« Reply #2 on: October 24, 2014, 11:04:28 PM »

Hi , I don't understand how to use this.
The message should apear within the tooltip for a specific textbox.

And what about the prompt?

Thanks.
Jaimi
Logged
jarry
Administrator
Hero Member
*****
Posts: 2300


View Profile Email
« Reply #3 on: October 25, 2014, 02:27:07 AM »

Please read this documentation to learn how to extend a validation type and apply it to a component.
http://www.jeasyui.com/documentation/validatebox.php
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!