Convert space to URL encode : Document : Development JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Development » Document »

 

Convert space to URL encode



<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>
           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Development
» Document