javascript - Submit form after progress bar submit animation -
I need your help.
I have some submit buttons with animation, here's a work demo:
http://plnkr.co/edit/KhDdXWYnj3kVxhiKaEFL
but submit now does not work, just ask and play the animation. Do not submit the form
& lt; Button type = "submit" name = "send_approve" onClick = "return message1 ()" class = "progress-button" data-style = "rotated-back" data-perspective data-horizontal & gt; Enviar & lt; / Button & gt;
This is the code for animation:
[]. Slice.call (document.querySelectorAll ('button.progress-button')) .forEach (task (BTN) {new progress button (BTN, {callback: function (instances) {var progress = 0, interval = set interval (function ( ) {Progress = Math. Middle (Progress + Math. Rendum) * 0.1, 1); Example._set progress (progress); if (Progress === 1) {instance._stop (1); Clear Interval (Interval); }}, 200);}}};});
Before the animation I did it and works fine, but now I just submit the press button, animation and confirmation without confirmation
function Message1 () {var r = Confirm ("¿Required Submit?"); If (r == true) {return true; } And {warnings ('this did not work'); return false; }}
Do you know how I can do this? Thanks for your help!
OK, first make sure that you remove that code form
tag with all the other fields, such as:
& lt; Form name = "the form" method = "get" action = "http://www.google.ro/search" & gt; & Lt; Input name = "q" type = "text" placeholder = "enter search keyword" / & gt; & Lt; Button type = "submit" & lt ;! - Other features except onclick - & gt; & Gt; & Lt ;! - The rest of the content, such as those spans go here - & gt; & Lt; / Button & gt; & Lt; / Form & gt;
Third, in JS, submit the form just after the progress:
if (progress === 1) {instance._stop ( 1); Clear interval (interval); Document.forms ["theForm"] presented (). }
Comments
Post a Comment