This has probably already been gone through but I just figured it out so....
If you want to validate a bunch of things in PHP (serverside) and have it display helpful messages.
1. Add a PHP action under setup. For example:
Name: customValidation
$valMessage = [ ]; if(empty($this->data("aTextField", ""))) { $valMessage[ ] = "The text field should not be empty"; }
if($this->data("aNumberField", "") != 12) { $valMessage[ ] = "Number field should be 12"; } (etc etc etc etc)
return $valMessage;
Each message just do $valMessage[ ] = (the message) to add it onto the message list
2. Put in an event switcher Data provider: {var.empty:customValidation} Events: true, false click update events list
3. Drag a message and an event loader into the "false" bit content: {var:customValidation}
Now, if there are any error messages they all get displayed correctly as a list with bulletpoints and everything. The event loader reloads the page and stops the crappy data being submitted any further. Makes sure you put it UNDER the message, or the message won't be displayed.
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine! Donations: paypal.me/healyhatman Professional Work: kamron@skyspider.com.au Custom CF / CC Plugins and Extensions: skyspider.com.au/store
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine! Donations: paypal.me/healyhatman Professional Work: kamron@skyspider.com.au Custom CF / CC Plugins and Extensions: skyspider.com.au/store
If you want to validate a bunch of things in PHP (serverside) and have it display helpful messages.
1. Add a PHP action under setup. For example:
Name: customValidation
Each message just do $valMessage[ ] = (the message) to add it onto the message list
2. Put in an event switcher
Data provider: {var.empty:customValidation}
Events: true, false
click update events list
3. Drag a message and an event loader into the "false" bit
content: {var:customValidation}
Now, if there are any error messages they all get displayed correctly as a list with bulletpoints and everything. The event loader reloads the page and stops the crappy data being submitted any further. Makes sure you put it UNDER the message, or the message won't be displayed.
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store