Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
William Gosse
aui:form and onsubmit issue
April 30, 2012 1:22 PM
Answer

William Gosse

Rank: Expert

Posts: 357

Join Date: July 4, 2010

Recent Posts

When I add an onsubmit to my aui:form tag it doesn't seem to prevent the submission even the javscript that's called is returning false.

I even tried just having onSubmit="return fales;" in the aui:form tag which didn't stop the submission as well.

I'm trying to add this to the standard login.jsp.

Is there something special about how aui:form handles onsubmits?
William Gosse
SOLVED: aui:form and onsubmit issue
May 14, 2012 3:40 AM
Answer

William Gosse

Rank: Expert

Posts: 357

Join Date: July 4, 2010

Recent Posts

I got this to work by moving my javascript call to the onclick on the submit button.
daddy 32
RE: SOLVED: aui:form and onsubmit issue
January 29, 2015 1:03 AM
Answer

daddy 32

Rank: New Member

Posts: 1

Join Date: December 9, 2013

Recent Posts

William Gosse:
I got this to work by moving my javascript call to the onclick on the submit button.


But that's not a solution - what happens when user submits the form by pressing enter?
Brijesh Desai
RE: SOLVED: aui:form and onsubmit issue
February 22, 2016 2:48 AM
Answer

Brijesh Desai

Rank: Junior Member

Posts: 44

Join Date: October 22, 2014

Recent Posts

We were struggling with same to return false from js method which is called from onSubmit of form.

AUI form , onSubmit= "return false;" doesn't work.

Work around is put following on your aui form.
<aui:form id="setup-property-fm" onSubmit="event.preventDefault(); addproperty();" </aui:form>

event.preventDefault() is working and validated.

Thanks,
Brijesh D
Abdur Rasheed
RE: aui:form and onsubmit issue
February 23, 2016 2:13 AM
Answer

Abdur Rasheed

Rank: Junior Member

Posts: 71

Join Date: September 25, 2008

Recent Posts

Hi ,
Check your script whether it is loading or not.
Brijesh Desai
RE: aui:form and onsubmit issue
February 23, 2016 6:19 AM
Answer

Brijesh Desai

Rank: Junior Member

Posts: 44

Join Date: October 22, 2014

Recent Posts

Abdur rasheed:
Hi ,
Check your script whether it is loading or not.



Yes, it is loading and working as expected and validated.

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!