Only allow postitive numbers in text field

Only allow postitive numbers in text field

badbytebadbyte Posts: 33Questions: 7Answers: 0

I have table with input fields which I'd only want to allow the user to enter positive integers. Is there a functionality to make input validation?!

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    Is this using Editor? If not, you can use input attributes - see here. If you are, try an event, either server-side or client-side (preSubmit).

    Colin

  • badbytebadbyte Posts: 33Questions: 7Answers: 0

    I want the validation made on the browser side, and that should be made in form of events or as parameter passed to my datatable. I think that datatable doesn't have such a parameter?

  • kthorngrenkthorngren Posts: 21,174Questions: 26Answers: 4,923

    Use the input attribute as Colin mentioned or if you want an event then you will need to create an event handler. If you aren't using Editor then you are responsible for handling the input as Datatables knows nothing about it. See this example for the recommended way to create events.

    Kevin

This discussion has been closed.