I am writing a replace function in Javascript to remove the spaces in a filename which is used for file upload. Somehow my replace function is not getting executed.
Here is the code:
<SCRIPT language = JavaScript>
function test () { var str1 = document.formname.filename.value str1 = str1.replace(" ", "%20"); } </script> and this function is called on the submit button.
Can you please let me know where I am going wrong.
Thanks
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
6
posted
0
you want to do this:
but you might be better off by doing
Eric [ May 25, 2005: Message edited by: Eric Pascarello ]