CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 custom code css5.1 very weird [SOLVED]

Print topic Send  topic

Author Message
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


View profile  Send private message
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????????
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.