Script Categories













Forms >>> Spaces To Plus.

Replaces single or multiple spaces in a text box entry with plus (+) symbols. Handy if your server's form processing or database management program requires this type of encrypted format.

Your Full Name:

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 convertSpaces(str) {
var out = "", flag = 0;
for (i = 0; i < str.length; i++) {
if (str.charAt(i) != " ") {
out += str.charAt(i);
flag = 0;
}
else {
if(flag == 0) {
out += "+";
flag = 1;
      }
   }
}
return out;
}
//  End -->
</script>
<form>
Your Full Name:  <input name=input type=text size=15 onBlur="this.value = convertSpaces(this.value);">
<input
type=button value="Ok!">
</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!).




©