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

 value validation and processing error

Print topic Send  topic

Author Message
Heinz

Posts: 9
Posted: 12/11/2006, 10:00 AM

I tryed to process a custom error, without success.
Let me explain:
I build an editable grid which the user can use to add or change existig data.
One field in this grid is an integer field (Name: Anteil) .
The single value of this field should be less or equal 100.
(This validation works fine)
The total over all the grids single values out of this field(Name: Anteil_total) should also less or equal 100.
I create a label with the name: Anteil_total and insert a code to calculate the total sum of all Anteil
When the user adds a row/value the total field will calculate and shows the total of all single values. (This also works fine)
Then I entered the following code in the onValidate Event of the field Anteil

If T_Empl_Anteil_GB_PB_Funkt.Anteil_total.Value +T_Empl_Anteil_GB_PB_Funkt.Anteil.Value > 100 then
T_Empl_Anteil_GB_PB_Funkt.Errors.addError("The total % over all should be less or equal 100%")
end if

But this did not work! Why?
I tryed to change the label Anteil_total to an input field and copyed the same code in the OnValidate Event of this field.
I tryed to enter the same code in different Events, all without success.

I figured out, that the code T_Empl_Anteil_GB_PB_Funkt.Errors.addError("The total % over all should be less or equal 100%")
was processed, but no Error appears

I am confused and it is difficult to explain it in english.
So I am still waiting for an idea what I did wrong or how I can fix it.

Thank you in advance
Regards
Heinz

Thank you in advance
View profile  Send private message
Edd


Posts: 547
Posted: 12/11/2006, 1:55 PM

Heinz,
The problem is that your total field "Anteil_total" is not ROW based.

I had a similar problem and resolved it very easily bit using Javascript.

On your Submit button link to a function that does the validation and does not let the submit pass, unless the it passes the validation.


Edd
_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
View profile  Send private message
Heinz

Posts: 9
Posted: 12/11/2006, 10:23 PM

Hello Edd,
I am not realy good in combining vbs-asp and javascript.
And for the moment I have addiditonal questions in my brain (let me say loud thoughts)
1) Why is it a problem that "Anteil_total" is not row based? The value is for each row higher then allowed?
2) If your right with your suggestion it should be easy to change it to row based total?
3) If I try to realise your suggestion, how can break the submit with java script?
But I will try to follow your idea and I will post the solution if I will get it ;-)

Thank you very much.
Regards
Heinz

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.

Web Database

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.