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 difference between executescalar and executenonquery?

941


What is the difference between sealed vs static class?

1029


What do you mean by query string?

896


What are the memory-mapped files?

953


What is asp.net futures?

1039


Does asp.net still recognize the global.asa file?

1020


Can you change a Master Page dynamically at runtime?

925


What is the difference between asp.net mvc and asp.net webforms? : asp.net mvc

999


How to deploy/publish webservices?How many ways?Plz explain me

2230


What happens if an ASP.NET server control with event-handling routines is missing from its definition?

1069


I am trying to implement sorting facility from client side code in GridView Control. So how can I fill up an Array inside client side code (using JavaScript), i want to assign my DataSet object declared and filled up on Server side(in code behind) to the array (on client side)

1936


Write code to send e-mail from an asp.net application?

968


Is post back property in asp net?

975


what is publisher?

2036


What are navigation controls? How many navigation controls are there in ASP.NET 4.0?

909