Script Categories

Forms >>> Encode Special Characters.

When submitting the form "GET" method, JavaScript can encode special characters with the escape() function. Great! (Enter a nickname or password with some special variables then click 'submit' to see the web address which contains the encoded (%xx) characters.


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

<script language="javascript" type="text/javascript">
/* Visit for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
function processForm(form) {
var nickname = form.nickname.value;
var password = form.password.value;

nickname = escape(nickname);
password = escape(password);

window.location = window.location + "?nickname=" + nickname + "&password=" + password;
//  End -->
<form action="">
Nickname:  <input type=text name=nickname value="" size=10>
Password:  <input type=text name=password value="" size=10>

type=button value="Submit!" onClick="javascript:processForm(this.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!).