Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Use a function for format
jdyoumans
Newbie

Posts: 1
Registered: 7/17/2004
Member Is Offline
posted on 7/18/2004 at 01:49 AM Reply With Quote
Use a function for format


I would like to use the format option with a function instead of the default options. So I have a js function that checks a date and returns ture or false that is called isDate(dtDate). I have tried to do 'f':'isDate(txtdate);' but it does not seem to work. Any suggestions?
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 7/20/2004 at 06:57 PM Reply With Quote

'f':isDate
View User's Profile View All Posts By User U2U Member
mmanners
Newbie

Posts: 1
Registered: 1/12/2005
Member Is Offline
posted on 1/12/2005 at 12:16 AM Reply With Quote
Using a custom function for field format


I have included a excerpt of the code I am trying to get to work. The only thing I have changed is the 'f':'real' to 'f':'inRange' according to your suggestion.

Code:

...
var o_fields_test = {
'price' : {'l':'Price','r':true,'f':'inRange','t':'t_price'}
},
...
function inRange(newPrice) {
if( newPrice < 5.00 || newPrice > 20.25 ) return false;
return true;
}
...


However, no matter what value I place in the field 'price', it always passes validation.

Can you please help?
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 3/1/2005 at 12:54 AM Reply With Quote

try moving definition of inRange above the structure where you use it and refer to it as 'f':inRange
View User's Profile View All Posts By User U2U Member
Filipo
Junior Member

Posts: 2
Registered: 10/5/2005
Location: BogotA? - Colombia
Member Is Offline
posted on 7/7/2006 at 11:43 AM Reply With Quote

'f':inRange, not 'f':'inRange' without '

var o_fields_test = {
'price' : {'l':'Price','r':true,'f':inRange,'t':'t_price'}
},
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Product Demos
Registration Form Validation
Login Form Validation
Multiple Forms Validation
Product Documentation Documentation
Documenation Page
Change Log
Validators Comparison Table
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004