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 -> General/Other

 how to use validation rule property?

Print topic Send  topic

Author Message
CodeChargenewbie

Posts: 114
Posted: 01/22/2008, 2:21 PM

How do I use the validation rule property? I know I can do on validation event on a control or form and accomplish what I wish in that fashion. But how do I enter code in the validation rule properties window? I'm using PHP. I'm trying to do something like this:

if($Form->ControlName->GetValue() != ""

Then, in validation text, I'd write "Please Enter some data" (without quotes). How the heck do I use this property???

Thank you.
View profile  Send private message
DonB
Posted: 01/23/2008, 5:48 PM

I don't use it myself, always seem to end up putting in a validate() event.
But fill in the property and see what the code generates. One thing I
suspect is you have to reference $this->ControlName->GetValue() or
$this->GetValue, just because of the context in which the validation rule is
used. It's different that when your inside an event handler.

--
DonB

http://ccswiki.gotodon.net


"CodeChargenewbie" <CodeChargenewbie@forum.codecharge> wrote in message
news:247966c56edfef@news.codecharge.com...
> How do I use the validation rule property? I know I can do on validation
> event
> on a control or form and accomplish what I wish in that fashion. But how
> do I
> enter code in the validation rule properties window? I'm using PHP. I'm
> trying
> to do something like this:
>
> if($Form->ControlName->GetValue() != ""
>
> Then, in validation text, I'd write "Please Enter some data" (without
> quotes).
> How the heck do I use this property???
>
> Thank you.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

CodeChargenewbie

Posts: 114
Posted: 01/24/2008, 8:39 AM

I know how to use it now!

Thank you. I looked at the generated code for validation and saw exactly what it does. it already adds an if statement, and it refers to the form using the $this variable. So, as an example, to validate if a control value is set to "A", then issue an error statement, I'd do the following:

In Validation Rule, I'd type $this->Control->GetValue() == "A"

In Validation Text, I'd type "A" is not valid

if you go into the generated code, it reads:

if(! ($this->Control->GetValue() == "A")) {
$this->Control->Errors->addError("\"A\" is not valid");

Glad I finally figured out how this feature works. I wish Codecharge would come out with a huge, comprehensive book, explaining every single detail there is to know with plenty of examples and explanations -- it would make life a lot easier for its users :)
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.