Hello,
I am using the CustomeditorTemplate sample and adding my Project specific fields. My requirement is in custoeditoetemplate ObjectID should be hidden field and another textfield for description and on a button click i choose object from a popup window and populate description and hidden field ObjectID. On save should get objectid and description both.
But with hiddenfield ObjectID is always null . So i tried ObjectID as TextBox and populate a dummy text 'hello' on button click. Interesting to see the 'hello' in the TextBox but when i click save ObjectID is null. But if i edit hello to hello1 or something just Need to edit and then click save then i get Objectid value.
Why so, populating in jquery does not make textbox dirty ?
here is the customeditortemplate code
< script>
function TestClick(e) {
$('input[name="txtObjectID"]').val('hello');
};
< /script>
< div class="k-edit-label">
@(Html.LabelFor(model => model.ObjectID))
< /div>
< div data-container-for="ObjectID" class="k-edit-field">
@(Html.TextBoxFor(model => model.ObjectID, new { @class = "k-textbox", data_bind = "value:ObjectID",Name="txtObjectID" }))
< input class="k-button" id="searchBtn" style="width:20px" type="button" value="...." onclick="TestClick(this)" />
< /div>
I am using the CustomeditorTemplate sample and adding my Project specific fields. My requirement is in custoeditoetemplate ObjectID should be hidden field and another textfield for description and on a button click i choose object from a popup window and populate description and hidden field ObjectID. On save should get objectid and description both.
But with hiddenfield ObjectID is always null . So i tried ObjectID as TextBox and populate a dummy text 'hello' on button click. Interesting to see the 'hello' in the TextBox but when i click save ObjectID is null. But if i edit hello to hello1 or something just Need to edit and then click save then i get Objectid value.
Why so, populating in jquery does not make textbox dirty ?
here is the customeditortemplate code
< script>
function TestClick(e) {
$('input[name="txtObjectID"]').val('hello');
};
< /script>
< div class="k-edit-label">
@(Html.LabelFor(model => model.ObjectID))
< /div>
< div data-container-for="ObjectID" class="k-edit-field">
@(Html.TextBoxFor(model => model.ObjectID, new { @class = "k-textbox", data_bind = "value:ObjectID",Name="txtObjectID" }))
< input class="k-button" id="searchBtn" style="width:20px" type="button" value="...." onclick="TestClick(this)" />
< /div>