2013年9月19日 星期四

css-disabled javascript-disabled html-diabled button-css-disabled



css button disabled
button[disabled=disabled], button:disabled {opacity:0.2;}



$('input[type="text"]:not(.approveAllow)').keypress(function(e){e.preventDefault();}); 
$('input[type="TEXT"]:not(.approveAllow)').keypress(function(e){e.preventDefault();}); 
$('input[type="text"]:not(.notDisabled,.approveAllow)').each(function() {this.disabled='disabled';})
//20140513 when enable it, status cannot save. $('input:not(.viewUpload)').each(function() {this.disabled='disabled';})
$('select').each(function() {this.disabled='disabled';})
//$('textarea').each(function() {this.disabled='disabled';})
$('button:not(#vView,.whenApprove,.deleteAllowWhenApprove)').each(function() {this.disabled='disabled';})
$('.SaveButton').each(function() {this.disabled='';})
$('input:not(.approveAllow)').prop('readonly', true);
$('textarea:not(.approveAllow)').prop('readonly', true);



$('input[type="text"]').keypress(function(e){e.preventDefault();});
$('input[type="TEXT"]').keypress(function(e){e.preventDefault();});
$('input').keypress(function(e){e.preventDefault();});
$('select').each(function() {this.disabled='disabled';})
$('textarea').each(function() {this.disabled='disabled';})
$('button').each(function() {this.disabled='disabled';})
$('.SaveButton').each(function() {this.disabled='';})




combo control element disabled / enabled
<span>
<label for="com" > Login ID (email)</label>
<select name="userRoleUserID" id="userRoleUserID"
onchange="if(this.value){
$('#admin').removeAttr('disabled');
$('#resetPasswordButton').removeAttr('disabled');
} else {
$('#resetPasswordButton').attr('disabled',true);
$('#admin').attr('disabled',true);
}"></select>
</span>




javascrip-disabled


function _disabled(v_field_,v_mode_){$(v_field_).each(function() {this.disabled=v_mode_;})}



html-disabled


http://www.w3schools.com/cssref/tryit.asp?filename=trycss3_enabled_disabled


<!DOCTYPE html>
<html>
<head>
<style>
input[type="text"]:enabled
{
background:#ffff00;
}
input[type="text"]:disabled
{
background:#dddddd;
}
</style>
</head>
<body>

<form action="">
First name: <input type="text" value="Mickey" /><br>
Last name: <input type="text" value="Mouse" /><br>
Country: <input type="text" disabled="disabled" value="Disneyland" /><br>
</form>

</body>
</html>




http://www.456bereastreet.com/lab/styling-form-controls-revisited/disabled/

  1. [disabled] { /* Text and background colour, medium red on light yellow */
  2. color:#933;
  3. background-color:#ffc;
  4. }

沒有留言:

張貼留言