I have two buttons in my django-crispy-form
self.helper.add_input(Submit('submit', 'Submit'))
self.helper.add_input(Button('cancel', 'Cancel'))
The submit button works just fine, the cancel button does nothing. As i am quite new to django/pyhton, how would i add a goto url (e.g. url below) to the action of the cancel button?
url(r'^customeroverview/$', 'customer.views.customeroverview', name='customeroverview'),
I have read that this is possible with JQuery, but this is something i never used. Eager to learn so if this would be the best option i am open to suggestions. Keep in mind i use the crispy form and want to use ass little html as possible.
If jQuery is used;
I figured it out, I used the following;
self.helper.add_input(Button('cancel', "Cancel", css_class='btn', onclick="javascript:location.href = '/customeroverview';"))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With