HTML input restrictions does not work??

HTML input restrictions does not work??

kaustubh.agrawal2000kaustubh.agrawal2000 Posts: 88Questions: 39Answers: 2

I am trying input restrictions with my datatable editor .. but dont seem to be working..

  attr: {
    type: "number",
    min : "1",
    max : "10"
  }

Although the number restriction is working fine.. but I am still able to input & post value > 10 ..

Am I missing something here ??
When I inspect the html, I can see the attributes properly.. but I am still able to post value > specified.
Is there a workaround ??

Answers

  • allanallan Posts: 61,892Questions: 1Answers: 10,144 Site admin

    It looks like the number input type element does restricted the numbers when using the arrows in the input, but not when you enter numbers via the keyboard: https://jsfiddle.net/pL0ny1ot/ .

    A validator on the server-side would be needed.

    Allan

This discussion has been closed.