Script Categories













Forms >>> Strip Characters.

Strips the characters from an input string. You can change the characters you want removed from the string by changing one line of code.

This demo form will filter out all numeric values from the form below. Enter a combination of alpha and numeric characters and click "Submit" to view the results.

Add the below code to the <body> section of your page:

<script language="javascript" type="text/javascript">
/* Visit http://www.yaldex.com/ for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
function stringFilter (input) {
s = input.value;
filteredValues = "1234567890";     // Characters stripped out
var i;
var returnString = "";
for (i = 0; i < s.length; i++) {  // Search through string and append to unfiltered values to returnString.
var c = s.charAt(i);
if (filteredValues.indexOf(c) == -1) returnString += c;
}
input.value = returnString;
}
//  End -->
</script>
<font face=arial size=-1>
This demo form will filter out all numeric values from the form below.  Enter a combination of alpha and numeric characters and click "Submit" to view the results.
</font>
<form name=thisform method=post action="" onSubmit="">
<input
type=text size=14 maxlength=14 name=inputField>
<br>
<input type=button value="Submit" onClick="stringFilter(inputField);">
<input
type=reset value="Reset">
</form>

JavaScript Editor Get Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.



Code was highlighted by 1st JavaScript Editor (The Best JavaScript Editor!).

Bitcoin Dice - Crypto Casino . site


©