Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hello friends,
 
I want to disable false my dropdown at page load. I write it in jquery page load but it did not worked.
Please suggest me where it is wrong my query mention below:
  $(document).ready(function () {
 
  $("#<%=ddlPaymentMethod.ClientID%>").attr('disabled', false);
 });
Posted 21-Dec-12 23:50pm
Edited 21-Dec-12 23:54pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I want to disable false my dropdown at page load.
If so, why not disable it in your designer to start with?
 
where it is wrong my query
Use proper selector to find the control and then set the needed attribute as mentioned below.
Example:
$(document).ready(function () { 
  $('#<%=ddlPaymentMethod.ClientID%>').attr("disabled","disabled");
 });
  Permalink  
Comments
shinebudy at 22-Dec-12 5:08am
   
Thanks sandeep its work
but I have two drodown one enable true and 2nd one enable false
I want script when I select 1st one than the 2nd one enable true any idea about that
Sandeep Mewara at 22-Dec-12 5:16am
   
Just enable the second dropdown on change() event. Something like:
$('#<%=ddlPaymentMethod.ClientID%>').onchange(function(){$('#<%=ddlCash.ClientID%>').attr("disabled","disabled");});
shinebudy at 22-Dec-12 5:20am
   
here you write only for enable false but what about enable true?
Sandeep Mewara at 22-Dec-12 5:24am
   
Well, other dropdown is disabled from before.
 
Once change even fires, enable it. I just told you how it can be done in my comment.... it's not the exact code. Did you not get the idea?
shinebudy at 22-Dec-12 6:16am
   
Understand but not whole part

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

  Print Answers RSS
0 OriginalGriff 304
1 Sergey Alexandrovich Kryukov 255
2 Shweta N Mishra 216
3 Maciej Los 210
4 PIEBALDconsult 184
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,586
3 Manas Bhardwaj 4,946
4 Maciej Los 4,665


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 22 Dec 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