CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 Validate city belongs to a state

Print topic Send  topic

Author Message
bedollandres

Posts: 48
Posted: 11/04/2005, 3:03 PM

I'm using the gofetch example to populate dependent lists, So when I select State1 it populates the cities listbox with the cities of State1.

But say the person is done filling the record form and clicks "insert", a required field wasn't filled so he has to fill it, the selected city still remains but the listbox is populated with all the cities, not only the ones from State1, how can I validate that the City selected belongs to the State1?

Just in case the user changes the selected city by mistake when getting the requiered field missing.

table_states
id_state
txtstate_name

table_cities
id_city
id_state
txtcity_name

_________________
bedollandres
View profile  Send private message
Edd


Posts: 547
Posted: 11/05/2005, 6:50 PM

In Javascript, you should create an Onload event.

I that event fire extract the value ot the State, if it is populated then fire the function that populates the Citires for that state.

This should hold true if the city field is populated.

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

http://www.syntech.com.au
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.