Semantic-ui: onSuccess() fires twice

Created on 29 May 2014  路  8Comments  路  Source: Semantic-Org/Semantic-UI

I was trying to track down a problem and realized my requests were going through twice.

I made a JSFiddle which shows this behavior: http://jsfiddle.net/iBotPeaches/NHxA2/4/

EDIT: I guess adding AJAX into the mix was not needed, onSuccess fires twice regardless: (non-ajax) http://jsfiddle.net/iBotPeaches/Hu32u/2/

0.17 - Semantic
29.0.1547 - Chrome

Confirmed Bug

Most helpful comment

This thing is shit, spend 3hrs looking for issue. moving to other options

All 8 comments

yep, i also encountered this issue..

Thanks, ill fix this.

I've realized the cause, and there's an easy fix. I'll fix in library too.

Either remove type="submit" from your button or change classname to ui button not ui submit button.

Form validation is automatically attaching form submit to ui submit button but not preventing default action, so it will submit twice with both there.

See Fixed JSFiddle

the submit event is also fired twice, which makes for some awkward behavior,

This thing is shit, spend 3hrs looking for issue. moving to other options

Hello,

Still experiencing this in version 2.2.6. The form still submits twice.

Replacing form tags with div while leaving the classes (<div id="register-form-0" class="ui form">) makes the form submit exactly once. Could there be a problem in blocking the original form submit event?

still wrong

Please use $('.ui.form') in the console to check how many elements it can find. If more than one, you should add your custom form class for each form, such as

<div class="ui form from-do-xxx">

Then use the added custom form class, not the ".ui.form", to write your code.

$(".from-do-xxx").form({
   xxx: yyy
})
Was this page helpful?
0 / 5 - 0 ratings

Related issues

guilhermeblanco picture guilhermeblanco  路  3Comments

arj-196 picture arj-196  路  3Comments

kntmrkm picture kntmrkm  路  3Comments

deneuxa picture deneuxa  路  3Comments

ghost picture ghost  路  3Comments