A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
ford Darcy Jr
Joined: Jan 26, 2005
May 25, 2005 08:33:00
Here is the code:
var str1 = document.formname.filename.value
str1 = str1.replace(" ", "%20");
and this function is called on the submit button.
Can you please let me know where I am going wrong.
Joined: Nov 08, 2001
May 25, 2005 08:46:00
you want to do this:
regEx = /\s/gi; str1 = str1.replace(regEx, "%20");
but you might be better off by doing
var str1 = escape(document.formname.filename.value);
[ May 25, 2005: Message edited by: Eric Pascarello ]
It is sorta covered in the
JavaRanch Style Guide
subject: Replace function
Problems with action
How to use JSTL varraible in to jsp
RegExp Help Needed!
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014