DataTables Table ID Conflicting with GetElementByID?
DataTables Table ID Conflicting with GetElementByID?
kraftomatic
Posts: 78Questions: 13Answers: 0
Hi Allan,
I'm running a DataTable without issue, except for when I try to introduce some hidden JS fields to submit behind the scenes. Everything works fine in Firefox, but IE (of course) throws an error. Here is the standard table setup:
[code]
2
Name
Product
Price
N/A
100
100
100
100
N/A
[/code]
The error is occurring on getElementByID:
[code]function setSelectedValues(lineNumber, diff, term, deliveryType)
{
document.getElementById('selectedPrice' + lineNumber).value = diff;
...
}[/code]
The error is "document.getElementById is null or not an object ... ". Now I know that code it outside of dataTables, but if I remove the id="example" from the table, the code works in both FF and IE. Is there any way to reference the dataTable code outside of an ID on the table? Or a better solution altogether?
Thanks.
I'm running a DataTable without issue, except for when I try to introduce some hidden JS fields to submit behind the scenes. Everything works fine in Firefox, but IE (of course) throws an error. Here is the standard table setup:
[code]
2
Name
Product
Price
N/A
100
100
100
100
N/A
[/code]
The error is occurring on getElementByID:
[code]function setSelectedValues(lineNumber, diff, term, deliveryType)
{
document.getElementById('selectedPrice' + lineNumber).value = diff;
...
}[/code]
The error is "document.getElementById is null or not an object ... ". Now I know that code it outside of dataTables, but if I remove the id="example" from the table, the code works in both FF and IE. Is there any way to reference the dataTable code outside of an ID on the table? Or a better solution altogether?
Thanks.
This discussion has been closed.
Replies