CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Custom error message in case of expression

Print topic Send  topic

Author Message
MarioM1977

Posts: 23
Posted: 10/22/2010, 10:33 AM

Hi,

Need help again. I have an SQL table, one example record:
Fields: ExpirationDate, CurrentPrice
Values: 2010-11-01 12:00:00, 200

There is also record grid with:
Label1 - shows value from "CurrentPrice" vield for the current record
Texbox1 - shows value "220" using code:
$Component->SetValue($Container->ds->f("CurrentPrice")+20);

Now user can put own price or leave the proposed price "220" and click submit. Now I need two messages for user in case:
"Put more money..." - if trying to submit same or lower price than value for current record in "CurrentPrice" field showed in Label1, and current date and time not reached value in ExpirationDate field

"Too late..." - if trying to submit bigger price than value for current record in "CurrentPrice" field showed in Label1, and current date and time reached value in ExpirationDate field

New price should be saved to DB only if no error message appeared.

How to manage it? My idea is to use Server->On Validate action for the record grid.

Thanks

View profile  Send private message
MichaelMcDonald

Posts: 640
Posted: 10/23/2010, 4:07 PM

You may be able to adapt this, it is a validation rule for confirming passwords from 2 text fields, one called password and the other called cpass.

($this->password->GetValue()) == ($this->cpass->GetValue())

and put an error message in your validation text.
_________________
Central Coast, NSW, Australia.

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.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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