CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 [Resolved] Trim Email Before Validation

Print topic Send  topic

Author Message
maxhugen

Posts: 272
Posted: 01/06/2009, 5:48 PM

I have an email field in a Record, with Input Validation set to "Email".

As sometimes the email is copied from another webpage, it's not unusual to inadvertently have a space at the beginning or end - and this will cause the validation to (correctly) fail.

The logical solution seemed to be to use the php function trim(), but the CCS built-in validation runs before the OnValidate event, so I can't use trim() there.

Any suggestions please?

MTIA
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
mentecky

Posts: 321
Posted: 01/06/2009, 6:48 PM

Max,

Try it in the page After Initialize.

Rick
_________________
http://www.ccselite.com
View profile  Send private message
maxhugen

Posts: 272
Posted: 01/06/2009, 7:19 PM

Thanks Rick

Although that didn't seem "intuitive" (to me, anyway), it certainly worked!

Cheers
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
mentecky

Posts: 321
Posted: 01/06/2009, 7:30 PM

Quote maxhugen:
Thanks Rick

Although that didn't seem "intuitive" (to me, anyway), it certainly worked!

Cheers

Max,

It's because EVERY submit to a form goes back to the same page, even if your result page is somewhere else. So the initialize functions will be called first.

Glad to help.

Rick
_________________
http://www.ccselite.com
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.