I do have a table which contain some data in it and a form besides it.I am binding this form on click of any row of the table means the data related to the respective row gets filled to the form which are coming from the database,my concern is that out of this data from the database one of the field is "def_text" which is basically stored in the HTML format but i want to show it in plain text format in the form where i am binding it.
<form class="form report live " data-table="contractlistTable" id="contractlistForm" data-bind="foreach:items" target="_blank" method="post">
<input type="hidden" name="pid" id="pid" />
<div class="control-group ">
<label class="control-label">Title</label>
<div class="controls">
<input type="text" id="title" name="title" required title="required" placeholder="title" data-bind="value:title" />
<input type="checkbox" id="active" name="active" class="check" data-bind="checked: active=='true'" />Active
</div>
</div>
<div class="control-group ">
<label class="control-label">Default Text</label>
<textarea id="def_text" name="def_text" class="htmleditor" rows="9" cols="50" style="width: 600px; height: 190px;" data-bind="value:def_text"> </textarea>
</div>
</form>
this is the form and the code for the table is
<table class="table table-hover table-bordered" id="contractlistTable" style="width: 304px;">
<thead>
<tr>
<th>Title</th>
<th>Active</th>
</tr>
</thead>
<tbody data-bind="foreach:items" class="bindable" data-model="companycontract">
<tr data-bind="attr:{'data-value': id,'data-index':$index}">
<td data-bind="text:title"></td>
<td>
<!-- ko if:active === 'true' -->
<span class="badge badge-success"></span>
<!-- /ko -->
<!-- ko if: active === 'false' -->
<span class="badge"></span>
<!-- /ko -->
</td>
</tr>
</tbody>
</table>
and for binding it i am using Knockout.js
$(function () {
var myForm = "";
var formFields;
$("#contractlistTable tbody tr").live('click', function () {
var data = [model.companycontract[$(this).attr("data-index")]];
if (!!formFields) formFields.refill(data);
else {
formFields = new DynamicModel(data);
ko.applyBindings(formFields, document.getElementById("contractlistForm"));
};
var id = [$(this).attr("data-value")];
var kunnr = $('#kunnr').val();
$('.report').attr("action", 'http://wcidevapps.com/salescentral/pcontract.php?ct=i&knr=' + kunnr + '&cid=' + id);
});
});
so please help me on this..