HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Changing order of validation rules on a form question. How do I?
peregrine
MVP
This is a question?? not an answer
let's says there is a form
input 1
input 2
input 3
you add an input 4 and a validation rule for input 4 if 4 is bad .... $Sender->Validation->AddValidationResult('input1',T('please enter input4')); $Sender->EventArguments['Valid'] = FALSE;
how do you get it to evaluate input1 2, and 3 rules first and then after that evaluate the rule you added in input4.
currently it seems to evaluate input4 before evaluating 1,2, or 3.
once 4 is correct if 1,2, or 3 display validation results.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
1
Comments
I might not understand the question these are the rules for my contact plugin
You get a separate warning for each and also a combo depending on how many you missed filling out..
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
I might not be presenting the question well. but you gave me the possible reason.
I mistakenly said input4 had a rule added when in fact it didn't, just a test of the form input and then this was applied, that explains it, it never got to the other rules.
$Sender->Validation->AddValidationResult('input1',T('please enter input4'));
so it looks like i may need to create some custom rules and apply them.
thanks, never occurred to me! doh!
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Each one gets it's own error
I would guess that without a rule it validates nothing ?
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
thx. we both edited messages.
like I said I tested data received from form and did my own checking without applying a rule, I still manually validated but.... Unfortunately my own checking caused my rule to be tested first. where as it would have been sequential if I created a custom rule and then applied it using the proper methods. Just tried to take a shortcut, which didn't work the way i wanted.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.