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 Related Topics
validate (regex) all fields dynamicly
validate all fields dynamically (including non required), check for legal characters and strip html, return error for client form
October 15, 2012
12:11 pm
michael
Guest

Hi there, love the plugin, love it!!

i have a multi form of 5, since not all of the fields are required so they  wont be checked for illegal entries (its potently unsafe if its save to database), can i run one function to check for all possibilities and make sure no illegal chars/nums.. etc, were entered.

So i can use as follows:

htmlentities

(

); 

// to strip html

and

function isValid($str) {
    return !preg_match('/[^A-Za-z0-9.#\\-$]/', $str);
}

// to validate

If i want to put it in to my_cforms_logic  function, how do i loop it thought all data – field names dynamically, and then set to return an error on the client form where the error was found?

Can any one help me please?


Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
25 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: 3762

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5359

Posts: 18741

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

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

Administrators: Oliver (6400), Nicky (3)