mikesarno
Posts: 1
|
| Posted: 08/10/2004, 12:27 PM |
|
I have an application page which includes a form with 2 listbox controls from which the user selects values. The form is somewhat complex and includes 14 separate fields - most of which are validated through custom code. (The validation code runs through the appropriate check on a field - and in the case of an error - returns an error message using the FormName.Errors.addError function.) In the event of a validation error, for some reason the listbox(es) are reset to "Select Value" although the textbox, textarea, radiobutton, and checkbox controls all retain the user supplied information.
The datasource for the listbox is a List of Values in the following format: Integer;Text:Integer;Text. The Data Type is set to Integer.
How can I get the listbox to display the value it contained when the form was submitted (before it failed validation) when it is redisplayed with the validation error?
Mike
_________________
Michael M. Sarno |
 |
 |
eiden
Posts: 34
|
| Posted: 08/16/2004, 5:29 AM |
|
I think this shoud work (not tested)...
Try this in your onValidate event:
with formname
If .listbox1.value = 1 then
.errors.adderror("wrong value")
.listbox1.value = .listbox1.value
end if
end with
|
 |
 |
|