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 / deepak

just write a javascript function like this
on button click or on onkeypress event of text box

function validate()
{
if(document.getelementbyid("ur dropdownlist").value=="other")
{
if(document.getelementbyid("ur textbox").value=="")
{
alert("please enter city name");
return false;
}

}

}

and call like this onkeypress='return validate()'

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the postback property in asp.net?

990


What are session state modes? List some of the important session state modes of asp.net.

952


Why do we need master page in asp.net?

943


Explain the use of duration attribute of @outputcache page directive.

1121


Where sessions are stored?

1101


Describe session handling in a webfarm?

1006


Why SessionID changes in every request in asp.net?

971


How is application management and maintenance improved in asp.net 2.0?

998


Is it right that ASP.NET Web API has replaced WCF?

972


Explain why datareader is useful?

993


Is web config mandatory?

969


What is difference between asp.net and asp.net mvc? : Asp.Net MVC

1058


Explain model, view and controller represent in an mvc application? : asp.net mvc

936


Explain the concept of event bubbling in ASP.NET?

1104


How do you hide the columns?

1036