<html>
<head><title>Convert space to URL encode</title>
<script>
function ConvertText(){
var textvalue = document.formtest.textest.value;
if (textvalue.indexOf(" ")){
var LinkText = textvalue.split(" ");
}
if (document.layers) {
document.layers.converted.document.write(textvalue);
document.layers.converted.document.close();
}else if (document.all) {
converted.innerHTML = LinkText[0] + "%20" + LinkText[1];
}
}
</script>
</head>
<body>
Enter two words with a space between them:
<form name="formtest">
<input name="textest">
<input type="button" value="Convert" onclick="ConvertText()">
</form>
<span id=converted style="position:absolute;"></span>
</body>
</html>
|