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

What is autopost?

1048


is gateway for sms continue connected for sending sms.how?

2313


Why is global asax is used for?

1144


How will create assesblies at run time?

1048


Is asp net front end or backend?

1067


What is the use of web.config file?

1066


What does a switch do?

1040


What is asp.net web application?

1101


What are the disadvantages of asp.net?

1134


How to you can limit Access to Web API to Specific HTTP Verb?

1261


What is difference between Server.Transfer and Response.Redirect in ASP.NET?

1144


What are the Types of objects in ASP

1165


Difference between Response.redirect vs server.transfer?

1259


Explain what is the procedure to create the environment for asp.net? : asp.net mvc

1085


Is post back in asp.net?

1016