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 windows service?
How would you turn off cookies on one page of your website?
Explain the difference between asp.net mvc and asp.net webforms
How long does an http session last?
how can we create wcf in asp.net and how can we cll that in to asp.net application?plsss tel me each step clearly
Which data type does the rangevalidator control support?
What is a postback ispostback and autopostback in asp net?
What is the basic purpose of the required field validator? How can you use a required field validator to check that the user changes the initial value of a text box? a listbox?
Why we use asp.net for website development?
How can we apply themes to an asp.net application?
how to debug web services on consumer side?
Explain one critical mapping?
Explain the features that make asp.net more used framework? : asp.net mvc
What is state management in .net?
How to disable cut, copy and paste in TextBox using jQuery in asp.net?