If you know the number of values ββthat you need each time, you can simply use JS For example, if 4 values ββwere entered into it, than it would be,
Js fiddle
The form
<form action="" method="post"> <p> <label for="txt">My txt: </albel> <input type="text" id="myTxt"><br /> <input type="submit" id="submitButton" value="Send"> </P> </form>
Js
document.getElementById('submitButton').onclick = function() { myVariable = document.getElementById("myTxt").value; alert(myVariable.slice(0, 4)); };
Regardless of what is entered in the text field, it will be cut with the first four characters.
source share