python - How to create an onClick event on a form submit button -



python - How to create an onClick event on a form submit button -

i trying create onclick event in django view. thought when user clicks "submit" on each page survey form value of jquery slider slider_value gets inserted list slider_dv_values.

however below effort if self.request.post.get('submit'): checks see if there 'submit' in self.request.post.get , hence triggered each time. want added after user has clicked submit.

how create onclick event below slider_value gets added slider_dv_values when user clicks submit on form page

views.py

if step == 5: if self.request.post.get('submit'): slider_value = self.request.post.get('slider_value') slider_dv_values.insert(step - 5, slider_value) print 'this slide value', slider_value

form.html

<input type="submit" name="submit" value="{% trans "submit" %}"/>

thanks

python django django-forms form-submit

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -