Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 3rd, 2006, 12:36 PM
Registered User
 
Join Date: Feb 2005
Location: city, state, USA.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default selective validation Country/State

i have a 2 combobox and a 1 textbox and a search button

1) country combobox
2) state combobox
3) textbox

when user click on search button without entering anything in the textbox then i'm inforcing user to enter (1) country and (2) city name (first 3 characters) which works great but i have a new requirement:

when the user select country = "United States" then i have to make sure user select

1)Country
2)State
3) city name (first 3 characters)

how do i do that?

the best example is here

http://www.peterblum.com/vam/DemoAll.aspx

when you select "united states" or "canada" the STATE required field is popup

same exact thing i want to implement


 
Old August 6th, 2006, 10:34 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

In the example it looks like the state textbox and validator control are enabled or disable on selection of the country.

 
Old August 9th, 2006, 11:51 AM
Authorized User
Points: 333, Level: 6
Points: 333, Level: 6 Points: 333, Level: 6 Points: 333, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Fresno, California, USA.
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The Country dropdown has "Enable AutoPoastback" set to true it looks like. The postback form selection changed for that control either enables the state field and validaton control or disables it. Looks like the validation control has some extra code to change the textbox color too. Similar to what I do with my controls except I actually hide them too. I see postback everytime the control is changed so there is no Ajax involved which makes it straight forward. :)


 
Old August 9th, 2006, 04:01 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Yep.. not too hard to implement.. :)






Similar Threads
Thread Thread Starter Forum Replies Last Post
select country in drop down and state accordingly vinodonline2000 ASP.NET 2.0 Basics 4 September 11th, 2007 09:42 AM
Problem with selective counting still_learning XSLT 1 March 22nd, 2007 06:27 PM
selective validation Country/State dsmportal ASP.NET 1.0 and 1.1 Professional 0 August 3rd, 2006 12:35 PM
Session State|View State|Do I have other options? rockon ASP.NET 1.x and 2.0 Application Design 2 October 5th, 2005 07:10 PM
Tip! Drop down "State", "Country" selections larry HTML Code Clinic 0 January 1st, 2004 11:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.