CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 ListBox - Set Value on Validation Failure

Print topic Send  topic

Author Message
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
View profile  Send private message
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
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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.