Leave modal open after adding record
Leave modal open after adding record
Loren Maxwell
Posts: 406Questions: 99Answers: 10
When creating a record, I'd like to have two buttons:
1) The traditional button that saves the new record and closes the editing modal
2) An additional button that saves the new record but refreshes the editing modal to be able to immediately add another record
1) is easy, but I'm not quite sure what action to call for 2).
Any thoughts?
This discussion has been closed.
Answers
This submits and reopens the form depending on the button clicked. I use bootstrap hence the bootstrap classes for the button colors. You can replace this with your own CSS.
Thanks, rf1234.
I was thinking the solution would be under the
formButtons
options.Something similar to the cancel button from this example:
https://editor.datatables.net/examples/api/cancelButton
Here's the solution I ended up with (notice the 'Submit and add another' button):