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 / swethasri

Client Side validation:
A Javascript function can be written to disable/enable the
text box and it can be called under
DrowpDownList_SelectIndexChanged event. We can provide an
if condition and get the required change in javascript
function.

or else

Server side validation:
we can make the dropdownlist 'AutoPostBack' property true.
and under the DrowpDownList_SelectIndexChanged event, we
can disable/enable the textbox.

Is This Answer Correct ?    11 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is content place holder?

522


How ASP and ASP.NET page works? Explain about asp.net page life cycle?

579


What is the use of response redirect in asp.net?

573


Explain the difference between the web config and machine config.

622


What is viewstate? What does the "enableviewstate” property do? Whay would I want it on or off?

517






benefits of migration from asp to asp.net hi frnds, i have to give presentation to a client about how useful would be migrating their project from asp to asp.net .plz give me some points which i should incorporate in my ppt thanks

1668


Can you dynamically assign a Master Page?

581


What is virtual directory in asp.net?

511


What is http pipeline in asp.net?

509


What is new asp.net core?

569


How do I upload a file from my ASP.NET page?

591


What is application and session in asp.net?

531


14. What are your Future Plans for Swatz Oils GROUP U.K?

1717


Will the asp.net validators run in server side or client side? How do you do client-side validation in .net? How to disable validator control by client side javascript?

520


What is the difference between login controls and forms authentication?

539