I have a function:
<input class="tf w-input" id="txtMsj" name="txtMsj" maxlength="256" placeholder="Identificación" type="text">
<input class="bn naranja w-button" onclick="goto('frm')" value="Siguiente">
goto( doc ){
var txtMsj document.getElementById("txtMsj").value;
}
That helps me to get the text from the screen but I don't know how to validate the special characters -> [?!))$&.'!"@&] with regular expressions.
This is the solution I implemented:
You can do it directly from HTML, thanks to the new HTML5 attributes:
Quick solution
The first thing we need to do is add a class to our Input so we can then reference it from a function in Jquery.
The min attribute is to indicate that 1 will be its minimum value, this way it will not accept negative values.
The next step will be to create a script to prevent the user from typing symbols in the input.
If you want the input to only load uppercase and lowercase text, numbers and not accept special characters you can add to the input
// function to only accept numbers and decimal point
// function to only accept numbers
// function to only accept letters
// function to only accept letters and numbers