3

Django accepts and works with form button in format:

<input type="submit" value="Submit" />

How to make it to work with the following:

<button type="button">Submit</button>
bobsr
  • 3,879
  • 8
  • 30
  • 37

2 Answers2

5

Could you explain what exactly you mean by "Django accepts and works with form button in format"? As far as I know the difference in the behaviour of <input type="submit" .../> and <button type="button">... has nothing to do with Django. Django does not care how a form is submitted from the browser.

This previously posted question might be of interest.

Community
  • 1
  • 1
Manoj Govindan
  • 72,339
  • 21
  • 134
  • 141
  • When both above examples are places in app, only first one is functional (updates database), second one is not click able, and not functional. – bobsr Aug 14 '10 at 14:04
1

Add the following to the button to submit the form: ("myform" is the id of your form)

onClick="javascript.document.myform.submit();"

dannyroa
  • 5,501
  • 6
  • 41
  • 59