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
What is a proxy in web service?
What’s the use of “GLOBAL.ASAX” file?
What is latest version of asp.net mvc? : Asp.Net MVC
what are configuration files?
Which protocol is used to call web service?
How do we implement bundling in MVC?
What is query string with example?
Describe paging in asp.net?
Is it right that ASP.NET Web API has replaced WCF?
How will you do windows authentication and what is the namespace? If a user is logged under integrated windows authentication mode, but he is still not able to logon, what might be the possible cause for this? In ASP.Net application how do you find the name of the logged in person under windows authentication?
How many types of triggers are there in update panel?
What are the benefits of view state?
Can any body provide me the sample web application in asp.net
What is asp.net and its advantages?
What is difference between asp.net and asp?