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


Please Help Members By Posting Answers For Below Questions

Explain the difference between authentication and authorization.

602


What is asynchronous call?

590


Explain asp.net page life cycle?

617


Explain the difference between asp and asp.net?

514


Explain cookies with example.

562






Is asp.net easy to learn?

557


Explain the concept of event bubbling in ASP.NET?

589


How can I create master page in asp net?

513


What is latest version of asp.net mvc? : Asp.Net MVC

481


Why session is more secure than cookies?

507


Explain in what order a destructors is called.

583


Explain how viewstate is being formed?

544


I have an excel file with data, i am importing this excel file data into Sqlserver 2005 database. while importing i am getting wrong data(ie, special characters) in one column(description column), upto some limit the data in that column is coming fine,after that data is coming like below. The "Walter" leather storage bench is one of our most popular styles. The top with the tufting and double stitching finish a very impressive piece. The size is perfect in front of beds and the storage adds another functional bonus. Open it up and sneak al���Ƴ�Â��ƴ�Ã��ƶ�Å�� al���Ƴ�Â��ƴ�Ã��ƶ�Å�� Is there anywhy to resolve this? (I am using recordset in coding for developing import process.) please help me soon.

1435


Explain the difference between response.redirect vs server.transfer

622


Explain about Multi-Language integration?

603