How to add non-data attributes to a form, with a custom button?
How to add non-data attributes to a form, with a custom button?
Hi Guys,
I'd like to add a number of non-data attributes to a form, which is then processed server side.
For example, 'number_of_copies' and 'new_document_prefix'. Theses are not stored in the database, but are used to process the selected row data. There are a large number of validations that need to be processed on the server side.
Is it possible to create a button that shows a custom form with additional attributes, that can be processed by 'preSubmit' before submitting it to the server?
The alternative is sending the selected rows to a separate form, and then return to DataTables page on submission.
I have searched the Documentation, and I am stumped. If anyone could point me in the right direction it would be greatly appreciated.
Thanks,
Nick
Answers
~~~~
Is this the right strategy?
Appolgies, I'm not quite understanding the intention. Let's take
number_of_copies
- do you just want that to be another form field that the user will fill in? You can do so even if that doesn't exist in the data for the table row - e.g.:Allan
Hi Allan,
Thanks for the reply. It pointed me in the right direction.
I ended up doing this:
Ultimately, I'll put the external form in a DataTables pop-over.