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
How does asp.net work?
is gateway for sms continue connected for sending sms.how?
What are type/key pairs in client script registration? Can there be 2 scripts with the same type/key pair name?
How do I publish my asp.net application to my isp's web server?
How use Xml data in ASP.net?
Can you explain one critical mapping? Performance issue which one is better?
What New Features comes with ASP.NET Web API 2.0?
How do I debug an asp.net application that was not written with visual studio.net and that does not use code-behind?
How to find last error which occurred?
What is the maximum timeout we can set for Cookies?
What is meant by web application?
Explain difference between dataset and recordset?
What is http only cookie?
What is the difference between mvc and asp.net? : Asp.Net MVC
What is Dynamic Web and discuss its usage with the help of real life examples?