cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Login form protected by Login LockDown.


Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Creating Custom validation of Fields
September 17, 2009
3:06 pm
Jason
Guest

Please replace the ??? with your dat!


[desc]:
Hi,  I want to write some custom validation routines for my cforms  – I know I can use reg expressions in the form creation but really want to be able to call a routine to validate the input and return something to the form indicating that that particlar field has failed. 

So can someone give me a simple example to get me started.

If I have a text feld (e.g. Name) and want to validate it is a string and has more than 10 characters – how and where would I write my own routine to do this check? How would I return a value indicating that a field has failed validation – can someone give me a solid example.

I repeat – I know I can do this using regulrar expressions when I decalre the form – but want this  to start me off. 

Thanks

Jason

September 18, 2009
7:31 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

forum search: a couple of weeks ago, a user posted a solution for non ajax….

September 18, 2009
11:34 am
Jason
Guest

Just done a  search on that item … and all that came up was my post. 

Could you please give me a link.

Jas

PS cForms is increbile.

September 18, 2009
11:50 am
Jason
Guest
May 24, 2012
3:01 pm
Sven
Guest

This guy did it….

http://www.digitaltonic.co.uk/2009/09/08/customisi…..ss-plugin/

 

for non ajax mode, wonderfull… 

i implemented a invitation key validation, which checks the database for valid keys.

 

i had to tweak the lib_validation.php … perhaps you like to add this tweak to the official release.

 

Yours Sven

 

PS: Besides … GREAT WORK Oliver ! 

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
26 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3761

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5358

Posts: 18739

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)