フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
William Gosse
aui:form and onsubmit issue
2012/04/30 13:22
答え

William Gosse

ランク: Expert

投稿: 277

参加年月日: 2010/07/04

最近の投稿

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
2012/05/14 3:40
答え

William Gosse

ランク: Expert

投稿: 277

参加年月日: 2010/07/04

最近の投稿

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
2015/01/29 1:03
答え

daddy 32

ランク: New Member

投稿: 1

参加年月日: 2013/12/09

最近の投稿

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
2016/02/22 2:48
答え

Brijesh Desai

ランク: Junior Member

投稿: 37

参加年月日: 2014/10/22

最近の投稿

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
2016/02/23 2:13
答え

Abdur rasheed

ランク: Junior Member

投稿: 71

参加年月日: 2008/09/25

最近の投稿

Hi ,
Check your script whether it is loading or not.
Brijesh Desai
RE: aui:form and onsubmit issue
2016/02/23 6:19
答え

Brijesh Desai

ランク: Junior Member

投稿: 37

参加年月日: 2014/10/22

最近の投稿

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



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