Form inputs used in Data Tables are defined wrong

Form inputs used in Data Tables are defined wrong

REJISREJIS Posts: 15Questions: 4Answers: 0

The dropdown/select with entries per page doesn't need a name assigned to it. Internally it is never used, and when datatables is used on a page with a form the data gets submitted since it has a name.

Buttons in the button bar also need a type of button. Without a type the default type is submit, so when Enter is pressed in a form it clicks the first Submit button on the page which can now be the first button in the button bar instead of the form submit.

Right now I have one line of code that removes the name attribute and another that sets a type for all the buttons in the div, but a fix in the library would be ideal.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Answer ✓

    The dropdown/select with entries per page doesn't need a name assigned to it.

    Fair point. I've added that to the list of things to be removed in v2.

    Buttons in the button bar also need a type of button.

    Committed just a day or so ago. Will be in the next release which should be fairly soon.

    Allan

This discussion has been closed.