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

 Can't Get Validation To Work On A Grid With Label Controls

Print topic Send  topic

Author Message
Suntower

Posts: 225
Posted: 10/06/2006, 1:01 PM

I have a fairly typical order entry grid. There is only one entry control for each row. It is called ORDERQUANTITY.

There is a label on each row for MAXIMUMORDERQUANTITY which is pulled from a Product Master table. This displays properly, as do all the other labels on the row:
Product ID
Description
UnitPrice
UnitOfMeasure

What I want is, in the validation to have something like

IF FORM.ORDERQUANTITY.Value > FORM.MAXIMUMORDERQUANTITY.Value THEN
.AddErrors("Quantity exceeded!")
END IF

But this doesn't work. And the reason it doesn't work is because the only value in the row which returns a value is ORDERQUANTITY. IOW: If I enter:

response.write FORM.DESCRIPTION.Value & " " & FORM.ORDERQUANTITY.Value
response.end

...in the OnValidation event, the ORDERQUANTITY will display, but not the DESCRIPTION

Why?

Now... when I enter an 'action' to validate against a constant (ORDERQUANTITY > 30) this works fine.

So... How do I retrieve the value in each row for labels for use in Validation?

---JC











_________________
---On a campaign for more examples and better docs!
View profile  Send private message
Suntower

Posts: 225
Posted: 10/06/2006, 1:22 PM

PS: If I change MAXIMUMORDERQUANTITY to an entry field the validation -does- work.

So it would seem that my guess was correct: Only -entry- type controls can be used for validation.

This is a drag. Is there no way to retrieve the value from row -label- controls?

---JC
_________________
---On a campaign for more examples and better docs!
View profile  Send private message
Benjamin Krajmalnik
Posted: 10/06/2006, 8:31 PM

Only way would be to code a lookup from the table, or the alternate method
which I sometimes use - place a hidden field.
You could also use custom SQL, creating the statement dynamically to use the
value already in the database in a computation.

More than 1 way to skin a cat, as they say.

"Suntower" <Suntower@forum.codecharge> wrote in message
news:64526baf625527@news.codecharge.com...
> PS: If I change MAXIMUMORDERQUANTITY to an entry field the
> validation -does-
> work.
>
> So it would seem that my guess was correct: Only -entry- type controls can
> be
> used for validation.
>
> This is a drag. Is there no way to retrieve the value from row -label-
> controls?
>
> ---JC
> _________________
> ---On a campaign for more examples and better docs!
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


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.