discuss.answer
this should work:
function tcsave(){
var e = $(this).parent().parent();
var t = e.children("td:nth-child(1)");
var n = e.children("td:nth-child(2)");
var r = e.children("td:nth-child(3)");
var i = e.children("td:nth-child(4)");
var u = n.children("input[type=text]").val();
var f = "object_id=" + t.html() + "&sr_description=" + u;
$.post("portal/edit-service-request", f, function(e) {
if (!$(e).find("#tcerrors").length) var t = e;
else {alert("Some Error :(");
return false
}
})
}
[[!FormIt?
&hooks=`spam,Formit2db`
&preHooks=`db2formit`
&packagename=`service_requests`
&classname=`service_requests`
&tablename=`service_requests`
&where=`{"id":"[[!getObjectId]]"}`
&validate=`
nospam:blank,
sr_description:required`
&successMessage=`It works`
]]
<form class="form" action="[[~[[*id]]]]" method="post">
<div id="tcerrors">[[!+fi.validation_error_message]]</div>
[[!fi.successMessage]]
<input name="nospam" type="hidden" />
<input name="object_id" type="text" value="[[!getObjectId]]"/>
<input name="sr_description" type="text" value="[[+fi.sr_description]]"/>
<input type="submit" value="Save"/>
</form>
you did it wrong.
This is not my code.
You did change my code.
Ok, I see what is different. Thanks