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
|
 |
 |
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.
|
 |
 |
|