Topic: Change coffeescript variable with onclick
Been working on this all weekend and need some help. Anyone know why this not working?
confirmExit = ->
"You have unsaved changes!" if needToConfirm
needToConfirm = true
window.onbeforeunload = confirmExit
<%= f.submit 'Save', class: "btn btn-large btn-primary", onclick: "needToConfirm = false" %></p>
I want to set needToConfirm to false if user clicks save button...
Last edited by dcastellano1 (2013-03-03 20:03:57)