Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Validation Engine 15 Sep 2013 15:16 #11093

  • VeCrea
  • VeCrea's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
This thing is killing me. I hate validation engine, but sure because i can't understand how it works if you want to be able to apply custom rules like past[NOW or a date]... I should just modify the xml file, shouldn't i ?
And what about : if some boolean is set to true, then one field becomes required. jQuery or ValidationEngine rule ?
Any clues or experience ?

Please Log in or Create an account to join the conversation.

Validation Engine 19 Sep 2013 09:28 #11110

  • VeCrea
  • VeCrea's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
anybody ?

Please Log in or Create an account to join the conversation.

Validation Engine 19 Sep 2013 09:35 #11112

Hi VeCrea,
I don't have a lot of experience on the jQuery validationengine plugin, I just modified it a bit to work with the bootstrap tabs, this is my experience on it.
I didn't understand clearly what you are trying to do, could you please do a simple example?

Please Log in or Create an account to join the conversation.

Validation Engine 19 Sep 2013 09:38 #11113

  • VeCrea
  • VeCrea's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
Checkbox : vehicule used or not ?
If checkbox is checked, then licence plate becomes required. If unchecked, licence plates should be empty and not required

Add a class in jQuery (validate[required]), or a specific rule in Validation Engine ?

Please Log in or Create an account to join the conversation.

Validation Engine 19 Sep 2013 09:41 #11114

reading the jquery validationengine API I used some conditional validation rule using:

validate[condRequired[ID_OF_THE_FIELD_REQUIRED]]



example from GITHUB :
<input value="" type="text" name="creditcard" id="creditcard" />
<input class="validate[condRequired[creditcard]]" type="text" id="ccv" name="ccv"/>


p.s.
I also updated the validationengine to the last release

Please Log in or Create an account to join the conversation.

Last edit: by Tomaselli. Reason: example added

Validation Engine 19 Sep 2013 09:53 #11115

  • VeCrea
  • VeCrea's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
Thanks, will try this again. K+

Please Log in or Create an account to join the conversation.

Validation Engine 19 Sep 2013 10:25 #11116

"again"?!?! so you tried it and didn't work? it perfectly worked to me, I added it in the XML, and it worked. in other situations I had to attach again the validation engine to the form, but I don't remember why, I think I added dynamically some fields, not sure.

Please Log in or Create an account to join the conversation.

Validation Engine 19 Sep 2013 11:38 #11117

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
When you want to create a custom regex.

Create a rule file in models/rules

for example : creditcard.php

Copy email.php as basis of file.
1. Rename php class
2. Rename $handler property
3. Write your regex in $regex property.

Then from css, you call it through class name :
validate[custom[creditcard]]
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Validation Engine 19 Sep 2013 11:44 #11118

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Possibly you do not have 'email' rule, you can copy another rule...
... Or also, more simple you can create a custom validator in Cook. Handler is the name of the rule.
After regeneration. Your custom rule will appear in the model/rules/ directory.

Also in the XML JForm define.
validate="creditcard"
Doing this way, your regex is also automatically applied in php to prevent injections.
(One Regex only for both JS and PHP)
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.076 seconds

  I found "cook" two days ago. Played around with it for a day and then within a day got rid of two legacy applications in IBM Lotus Domino Notes and replaced them with "cook". It was really easy. A piece of cake. Actually it was even easier than cooking. Cooking involves more work than developing with "cook". What can I say about "cook"? Great application great price for what it delivers great forum with a lot of information and fast responses active and friendly community fast forward moving development cycle So what should I say "Monsieur Le Cook"? Keep the good work going it will lead to success. Having become a paying member in the words of Edith Piaf may I say ..... non rien de rien ... je ne regrette rien. Vive La France.
FK (JED)
         

Get Started