We can pass whole form in ajax call by serializing the form
In your script:
var str = $('#<portlet:namespace/>formID').serialize();
$.ajax({
type: "post",
data: str,
dataType: 'text',
url: "<%=submitJobURL%>",
async: false,
success: function(data) {
alert("success");
}
});
And your form view in jsp:
<aui:form method="post" name="formID">
<aui:input name="formID" type="text" />
</aui:form>
Here formIDis your form id.
And we can get values in controller by normal way
String formID= ParamUtil.getString(request,"formID");
Wednesday, 8 November 2017
04:00
MR: EDITOR
TEST
I am Java Developer. I have 6 year Experiance in this field and like to post in blogging. So keep sharing and like my post
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment