I want to get the minutes and seconds from the timer in my template to my view.
I already tried different approaches with an ajax.post request but it didnt really work how I wanted it to be.
Here is my template:
Now I want to get the minutes and seconds to my view as a POST request after clicking on the submit button. My idea was it to hide the time in a input like this:
<input type="hidden" name="seconds" value="what should be in here???">
but I dont know what should be in value?
You can fill the input values inside your interval. Give your inputs ids (let’s say
#minutes-input), and use
$('#seconds-input').val(pad(++sec%60) inside the interval.
Even better, save the seconds and minutes as vars and then assign them to both spans and inputs.