How can the contents in input fields be copied when using Buttons?
How can the contents in input fields be copied when using Buttons?
cms1
Posts: 11Questions: 4Answers: 0
Hello,
Please see example below:
http://live.datatables.net/vigokehu/1/edit
I found this thread from 2016 but the solution no longer seems to work.
This question has accepted answers - jump to:
Answers
Using the suggestion Allan provided in the thread you linked I came up with this example that uses the
node
parameter:http://live.datatables.net/vigokehu/3/edit
Kevin
Thank you sir!
Hello,
Demo: http://live.datatables.net/mepaheko/1/edit
I'm trying to use the same solution above with an excelHtml5 Button which creates an excel spreadsheet from multiple tables.
Problem: I'm getting XML parsing errors when <input /> fields are on more than 1 table. (It seems to work with input fields only on the first table)
How to replicate:
1) Click the 'Excel' button above the first table
Question: How do I have the custom function for table 1's button also find the input.val for the other tables with input fields?
Any help or direction is appreciated
I updated this loop in the
getTableData(
function to check forinput
elements.If there is an input then get the value and replace the corresponding
data
array element with the value.http://live.datatables.net/sozuxona/1/edit
Kevin
Thank you once again Kevin
First tab works -- why are excel tabs 2+ returning undefined?
The if statement is likely wrong:
I don't have time now but you can use the browser's debugger to see what the value of this statement is when there is no
input
:You may need to check for length > 0 or something like that.
Kevin
Success!
if (input.length > 0 && input !== undefined)