Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
hi how to show disabled textbox when dropdonws selected item is comepleted.?can any one suggest me?
Posted 12-Feb-12 23:55pm
ythisbug2.1K
Comments
Dinesh Mani at 13-Feb-12 5:19am
   
Do you mean when the server event is complete?
fahadsheikhji at 13-Feb-12 5:30am
   
yea.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Try this
if(DropDown.SelectedText == "Completed")
     textbox.ReadOnly=true;
 
OR
 
     textbox.Enabled=false;
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

 <script type="text/javascript"> function changetextbox() 
{     if (document.getElementById("ddl").value === "noy")
 {         document.getElementById("txt").disable='true';     } 
else {         document.getElementById("txt").disable='false';     }
 } 
</script> 
 
<select id="ddl" name="ddl" onChange="changetextbox();"> 
    <option>Yes</option>     <option>No</option>
     <option>No, but planning in future</option> </select>
  <input type="text" name="txt" id="txt" /> 
  Permalink  
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

if(dropdonws.SelectedItem.Text=="Completed")
{
textBox.ReadOnly=true;
}
or
if(dropdonws.SelectedItem.Text=="Completed")
{
textBox.Enalbed=false;
}
  Permalink  
Comments
fahadsheikhji at 13-Feb-12 5:17am
   
m getting error for this both solution
 
Error 9 'System.Web.UI.WebControls.TextBox' does not contain a definition for 'Enalbed' and no extension method 'Enalbed' accepting a first argument of type 'System.Web.UI.WebControls.TextBox' could be found (are you missing a using directive or an assembly reference?)
Syed Salman Raza Zaidi at 13-Feb-12 5:39am
   
its Enabled not Enalbed, are you not using Visual Studio???
fahadsheikhji at 13-Feb-12 5:54am
   
using vb ..bt its not working..i gave enabled only..error nt der..
07navneet at 13-Feb-12 5:39am
   
check the spelling "enabled" not "enalbed"
fahadsheikhji at 13-Feb-12 5:53am
   
ya enabled only..but its not working..
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

if(dropdonws.SelectedItem.Text=="Completed")
{
textBox.disabled=false;
}
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 7,903
1 Sergey Alexandrovich Kryukov 7,127
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,820


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 13 Feb 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100