Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

In a page there is dropdown list with the name of the
cities like Bangalore,Pune,Chennai,Other and a text box
that would enable the user to enter the name of the city if
other is selected. How to enable validation on the text box
if other is selected

Answer Posted / swetha v

Hi Friends,

I hope the below solution helps....

1. Please add the required field validator for the texbox.
2. In Page_Load method, we can add the below statement

Dropdownlist.Attributed.Add
("OnChange","javascript:ValidateOtherCity();")

Add the below javascript function on the aspx page

function ValidateOtherCity()
{
var other = window.document.getElementById
("DropdownlistName");

if(other.value == 'Other')
{
ValidatorEnable(RequiredFieldValidatorName,true);
}
else
{
ValidatorEnable(RequiredFieldValidatorName,false);
}
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Diff between web user control and web custom control?

1023


What is css and what is it used for?

1035


What is meant by server side scripting?

1004


What are validator? Name the validation controls in asp.net? How do you disable them?

1091


If you want to bind the columns manually within the asp:datagrid tags what kind of tags you have to add.

1089


Should I delete cookies?

1019


How does asp page work?

1033


Explain what are the advantages of asp.net mvc framework? : asp.net mvc

1183


What is the difference between asp.net and mvc?

1164


What is http session state?

1024


Define the term Scavenging in Caching?

1082


What is the main difference between Asp.net and Vb.net?

1095


How does the iis work?

1086


What are the advantages of using sql stored procedures instead of adhoc sql queries in an asp.net web application?

1173


Describe the method to create a permanent cookie?

1129