Closed akeshavan closed 11 years ago
Ok so the issue for this is that if I attach the modal function to the "onclick" event of the Start RT button, the function runs but then the form is submitted, the page reloads, and my modal disappears!
@akeshavan, i had the same problem with generating the flots to begin with. i don't know what to do... @satra, ideas?
I can think of 2 things:
1) make Start RT in its own form, and the form has an onsubmit method which runs after the submit 2) for any button click that is not "Start RT" clear the flotscript (or the part of the flot script with the modal) altogether
For me 2) is easier, but I can dabble with the Mako template if I need to because 1) is cleaner
@sasen test my quick fix! The modal only pops up for Start RT. I think this is ready to merge for now, we can always clean this part up if/when we have time later
take a look at: view-source:http://people.iola.dk/olau/flot/examples/ajax.html
as you will see, the button never does a submit, but the script responds to the onclick and can do anything with the server.
@satra see this branch: https://github.com/akeshavan/realtime/tree/satra_dummylaunch
if you cp /home/ak/subjects/pilot17 to /home/satra/subjects it should work
This is pretty cool - When you start stimulus a modal pops up telling you not to click anywhere and it has a flot plot! Don't merge yet, need to somehow start modal from the start stim button or clear the flotscript, otherwise modal shows up on each reload or form submit.