下面的代码可能会帮助........
为此,我们需要两个JavaScript, 1)jQuery的1.9.1.js或任何 2)jquery.jeditable.js
<html>
<head>
<title>Hello!!!</title>
<script src="js/jquery-1.9.1.js"></script>
<script src="js/jquery.jeditable.js"></script>
<script type="text/javascript">
$.editable.addInputType('checkbox', {
element: function(settings, original) {
$(this).append('<input type="checkbox" id="check1_" name="check" value="OTCS" /> OTCS');
$(this).append('<input type="checkbox" id="check2_" name="check" value="OCJ" /> OCJ');
$(this).append('<input type="checkbox" id="check3_" name="check" value="OCAD" /> OCAD');
$(this).append('<input type="checkbox" id="check4_" name="check" value="OCB" /> OCB');
$(this).append('<input type="checkbox" id="check5_" name="check" value="ZINZENDORF" /> ZINZENDORF');
$(this).append('<input type="checkbox" id="check6_" name="check" value="Others" /> Others');
var hidden = $('<input type="hidden"/>');
$(this).append(hidden);
return(hidden);
},
submit: function (settings, original) {
//some code
},
content: function(string, settings, original) {
//some code
}
});
$(document).ready(function() {
$('#cb').editable('www.some.com/some.php',{
indicator: '<img src="img/indicator.gif">',
tooltip: 'Click to select',
loadtext: 'loading...',
type: 'checkbox',
onblur: 'submit',
cancel: 'Cancel',
submit: 'OK'
});
});
</script>
</head>
<body>
<h1>Hello!</h1>
<div style="border:red 1px solid;" id="cb"> Click me to turn in CheckBox....... </div>
</body>