How to implement restrictions on characters, size etc in Input type=Text

New Member


I have a text box input where a user is supposed to enter certain details. Is there a way to restrict the number and type of characters entered in the text box to ensure all data entered is valid data and not junk data.


Tags (1)
0 Karma


You can use javascript like the following in your application.js:

$("input").attr("maxlength", 4)

Here is a demo:

0 Karma
Get Updates on the Splunk Community!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

 (view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...