简体   繁体   中英

Reset Button in twitter bootstrap not working in django form

I am using the twitter bootstrap reset button like this

<input class="btn btn-danger" type="reset" value="Reset">

It works when i first load the form via django formView

But once i get the error in submission and i get the form back with data then reset form is not working. Is that ok or i have the problem

because when the form is reloaded with the errors,
django adds value="some value" to your text inputs or seleced to select or checked to checkboxes
what reset does is reset to the default value not clearing the texboxes or inputs

<form>
<input type="text" value="asd">
<input  type="reset">
</form>

here when the text box is edited and clicked reset, the text input will reset to value 'asd'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM