Click to See Complete Forum and Search --> : simple help needed re: strings, etc


stevec
10-17-2003, 12:33 PM
hey guys

im pretty inexperienced as far as javascript goes, but i am a developer, so i know this should be a really easy task to accomplish.

im using that formmail script on a webpage, and i can set multiple recipients if i seperate them with a comma. however when i use a multiple enabled select box in my form, it seperates things with a semicolon;

all i need to do is given a string traverse through it and replace all of the semi-colons with commas. sounds simple enough, but i havent been able to get it to work. i know of the .replace but maybe because the characters i have as parameters are special characters and not just letters it requires some kind of special formatting? i dont know, so i ask.

thanks!

Charles
10-17-2003, 12:36 PM
<script type="text/javascript">
<!--
alert('fee;fie;foe;fum'.replace(/;/g, ','))
// -->
</script>

But what of the 13% of users who do not use JavaScript?