2Code
Posts: 24
|
Posted: 05/27/2014, 6:45 PM |
|
ok I have a custom captcha and a checkbox for terms of service set up like this
Captcha image
Captcha field
checkbox - I agree
but the custom code errors don't show in order
Must agree to the terms.
Captcha code incorrect.
captcha should show first and terms should show last
|
|
|
2Code
Posts: 24
|
Posted: 05/27/2014, 7:21 PM |
|
ok here are the fields in order
Username
Email Address
Confirm Email
Birthdate
Captcha
Terms
and if I don't feel in the fields and hit register
here are how the errors show all out of wack
Username is required.
Email Address is required.
Birthdate is required.
Confirm Email is required.
Must agree to the Terms.
Captcha code incorrect.
Why would it show like that is it a bug????????
|
|
|
eratech
Posts: 513
|
Posted: 05/27/2014, 9:36 PM |
|
Probably not a bug as the validation is working, it's just the order of the messages that isn't matching what you want. It could also be the order in which you added the controls to the form that determine the Error order.
I suspect all the validations are done in the same area of code, so you could do a 'Custom Code' in the 'On Validation' event for the form (it should be at the bottom of the validations), and then copy the relevant validation code into there - it should be processed after the others and *should* turn up last. Of course, remove the 'regular' validation for the item you moved, or it will fire up twice.
Alternatively, you can also add labels next to fields and set individual controls with Error labels pointing to these new labels (ie: not into the default catch-all 'Errors' at the top of form)
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
2Code
Posts: 24
|
Posted: 05/28/2014, 5:17 AM |
|
HAHAHA it was the smallest thing I kept looking over I didn't have the error tied to the field lol
changed
$Component->Errors->addError
to
$Component->terms->Errors->addError
|
|
|
|