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