value1 = $("#<%=hid_Value.ClientID%>").val();
value1 = value1.substring(0, (value1.length - 1));
eval("var txtValue = {" + value1 + "}");
$("#<%=chbDrugList.ClientID%> input[type=checkbox]").each(function () {
var chbId = this.id;
if (this.checked) {
var txtId = $("#" + chbId).val();
$.each(txtValue, function (i, n) {
if (i == "txtDrug" + txtId) {
var volume = n;
var str = " <input name='' id='txtDrug" + txtId + "' onclick='javascript:return getvlaue(this)' type='text' value='" + volume + "'/>";
var lblstr = " <label id='lbl" + chbId + "'>mg</label>";
$("#" + chbId).parent().append(str).append(lblstr);
}
});
}
});
function getvlaue(obj) {
$("#" + obj.id).focusout(function () {
var oldValue = $("#<%=hid_Value.ClientID %>").val();
var txtValue = oldValue + obj.id + ":" + $("#" + obj.id).val() + ",";
$("#<%=hid_Value.ClientID %>").val(txtValue);
});
}