Tuesday, 1 June 2021

Flask: Submit a form using a slider

In flask, how can I create a 'slide to submit' like this?

  1. https://codepen.io/BoringCode/pen/FfzLs
  2. https://www.jqueryscript.net/form/jQuery-Plugin-To-Submit-A-Form-By-Sliding-slide-to-submit.html

I added

<script src="http://code.jquery.com/jquery-1.10.2.js"></script>  
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script> 

in my <head> tag in base.html and used the jquery from above fiddles to make it work. Funny thing is, this works -

<script src="http://code.jquery.com/jquery-1.10.2.js"></script>  
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>  
<script>
 
        $(".slide-submit button").html("test"); //test

</script>

but this doesn't

<script src="http://code.jquery.com/jquery-1.10.2.js"></script>  
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>  
<script>
 
        $(".slide-submit button").draggable();

</script>


from Flask: Submit a form using a slider

No comments:

Post a Comment