ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  ASP.NET
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 SharePoint interview questions  SharePoint Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
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
 Question Submitted By :: Mathew298
I also faced this Question!!     Rank Answer Posted By  
 
  Re: 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
# 1
By using custom validator.
 
Is This Answer Correct ?    7 Yes 1 No
Guneetinder Singh
 
  Re: 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
# 2
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 ?    6 Yes 0 No
Swethasri
 
 
 
  Re: 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
# 3
by using javascript function can be written to 
disable/enable the text box and it can be called under 
DrowpDownList_SelectIndexChanged event.
 
Is This Answer Correct ?    2 Yes 0 No
Rajesh
 
  Re: 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
# 4
U can do it By Adding a Required validator To the textbox 
with enabled is false...

no in the Drop downList selected IndexChanged make it 
enable True... this will solve the Isssue
 
Is This Answer Correct ?    1 Yes 0 No
Devkranth Kishore
 
  Re: 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
# 5
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 ?    1 Yes 0 No
Deepak
 
  Re: 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
# 6
On_page load
{
RequiredFieldValidator1.Enabled = false;
}

if (DropDownList1.SelectedItem.Text == "Other")
        {
            RequiredFieldValidator1.Enabled = true;
        }
        else
        {
            RequiredFieldValidator1.Enabled = false;
        }
 
Is This Answer Correct ?    1 Yes 0 No
Udai
 
  Re: 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
# 7
Hi Friends,

I hope the below solution helps....

1. Please add the required field validator for the texbox.
2. In Page_Load method, we can add the below statement

Dropdownlist.Attributed.Add
("OnChange","javascript:ValidateOtherCity();")

Add the below javascript function on the aspx page

function ValidateOtherCity()
{
  var other = window.document.getElementById
("DropdownlistName");

if(other.value == 'Other')
{
  ValidatorEnable(RequiredFieldValidatorName,true);
}
else
{
 ValidatorEnable(RequiredFieldValidatorName,false);
}
}
 
Is This Answer Correct ?    1 Yes 0 No
Swetha V
 

 
 
 
Other ASP.NET Interview Questions
 
  Question Asked @ Answers
 
In this case if exception occure in Database which catch block will be exexcuted? Microsoft1
We have 2 sites in which one site allows the user with out asking credentials and second one ask for credentials through a log page. What might be the configurations settings for both sites? We can use IIS and web.config files together. ADITI1
which scripting is used browser by server when we use validation controls. 1.javascript 2.vbscript 3.jscript 4.perl Satyam8
About friend and Protected friend ? MMTS3
I am trying to redirect another site on button click.  7
Can we change the page layout in ASP.NET 2.0 as Grid Layout like in previous version TCS2
How to change the form layout in ASp.net 2.0 ? Netsweeper1
Explain the differences between Server-side and Client-side code? Visual-Soft6
How to deploy the Asp.Net Project ?  3
write a sample code make use of xmltext writer GCI1
To call a Web service which transport protocol you can use?  3
Which two properties are there on every validation control?  2
wt is repeater control and wt is datalist control and wt defferences these two? i want some code in datalist?  1
Name the control which can be used to reserve the space on web page for storing localized data. IBM2
What is shared and private assembly? Accenture1
what does Page.IsValid in asp.net Net-Solution3
What is an application domain ? Microsoft2
What are different ASP.NET Web Forms with the technology different from though ASP (1.0-3.0)?  1
How many web.config a application can have ? Keane-India-Ltd5
Suppose you want a certain ASP.NET function executed on MouseOver over a certain button. Where do you add an event handler?  1
 
For more ASP.NET Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com