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 the difference between executescalar and executenonquery?
What is the difference between sealed vs static class?
What do you mean by query string?
What are the memory-mapped files?
What is asp.net futures?
Does asp.net still recognize the global.asa file?
Can you change a Master Page dynamically at runtime?
What is the difference between asp.net mvc and asp.net webforms? : asp.net mvc
How to deploy/publish webservices?How many ways?Plz explain me
What happens if an ASP.NET server control with event-handling routines is missing from its definition?
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)
Write code to send e-mail from an asp.net application?
Is post back property in asp net?
what is publisher?
What are navigation controls? How many navigation controls are there in ASP.NET 4.0?