论坛

主页 » Liferay Portal » English » 3. Development

组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
William Gosse
aui:form and onsubmit issue
2012年4月30日 下午1:22
答复

William Gosse

等级: Expert

帖子: 277

加入日期: 2010年7月4日

最近的帖子

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年5月14日 上午3:40
答复

William Gosse

等级: Expert

帖子: 277

加入日期: 2010年7月4日

最近的帖子

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年1月29日 上午1:03
答复

daddy 32

等级: New Member

帖子: 1

加入日期: 2013年12月9日

最近的帖子

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年2月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年2月23日 上午2:13
答复

Abdur rasheed

等级: Junior Member

帖子: 71

加入日期: 2008年9月25日

最近的帖子

Hi ,
Check your script whether it is loading or not.
Brijesh Desai
RE: aui:form and onsubmit issue
2016年2月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.