Foren
How to submit Form
ildar sl, geändert vor 7 Jahren.
How to submit Form
Regular Member Beiträge: 158 Beitrittsdatum: 12.12.11 Neueste Beiträge
Hi!!
Have:
view.jsp
modal.jsp
Already tried a lot of options. Do not sent the form. Since sendbutton created a javascript. Help me please.
Have:
view.jsp
Liferay.Util.openWindow(
{
dialog: {
modal: true,
toolbars: {
footer: [
{
label: Liferay.Language.get('ok'),
on: {
click: function(event) {
Object.keys(event).map(function(objectKey, index) {
var value = event[objectKey];
console.log("====="+value);
});
event.preventDefault();
event.domEvent.preventDefault();
}
},
primary: true
},
]
},
},
id: '<portlet:namespace />dialog',
uri: url.toString()
}
);
modal.jsp
<aui:form action="<%= addDDDURL %>" method="post" name="fm" onsubmit="<%= "event.preventDefault(); " + renderResponse.getNamespace() + "addDDD();" %>">
<aui:input name="bidName" />
</aui:form>
<aui:script>
function <portlet:namespace />addDDD() {
submitForm(document.<portlet:namespace />fm);
}
</aui:script>
Already tried a lot of options. Do not sent the form. Since sendbutton created a javascript. Help me please.
Andrew Jardine, geändert vor 7 Jahren.
RE: How to submit Form
Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
Hi Ildar,
Couple of things. First, I'm not seeing a submit button on your form -- assuming that you are providing just part of the JSP, how are you triggering the submit action? My next question is that I can see you have this -
Couple of things. First, I'm not seeing a submit button on your form -- assuming that you are providing just part of the JSP, how are you triggering the submit action? My next question is that I can see you have this -
<aui:form action="<%= addDDDURL %>" ...< code></aui:form>
<br><br>but you are not showing how you created that URL. Typically, since you have addDDDURL, which assume you created with either a <portlet:actionURL/> or a <liferay-portlet:actionURL/>, in which case all you should need to submit the form is a <aui:input type="submit"/> on your form.
ildar sl, geändert vor 7 Jahren.
RE: How to submit Form
Regular Member Beiträge: 158 Beitrittsdatum: 12.12.11 Neueste Beiträge
Hi Andrew!
Yes, of course I did not forget the generation URL
Yes you are right. Here, the problem is that submit button is not within a form. Even without inside modal iframe.
If the button is placed in modal.jsp all perfectly functioning. But this option is not currently fit to me
Yes, of course I did not forget the generation URL
<portlet:actionurl name="addDDD" var="addDDDURL" />
Yes you are right. Here, the problem is that submit button is not within a form. Even without inside modal iframe.
If the button is placed in modal.jsp all perfectly functioning. But this option is not currently fit to me
ildar sl, geändert vor 7 Jahren.
RE: How to submit Form (Antwort)
Regular Member Beiträge: 158 Beitrittsdatum: 12.12.11 Neueste Beiträge
Solved
Thanks to site https://www.sitepoint.com/community/t/how-to-submit-a-form-in-an-iframe-with-post-data/6089/2
Thanks to site https://www.sitepoint.com/community/t/how-to-submit-a-form-in-an-iframe-with-post-data/6089/2