remove special characters from a string using java script

suppose if i enter text in text box.IF i clicl ok button.

text should be contain only chararacters and numbers, reaming should be remove(eg:$%^&*() special charcters).

how to write code using java script.

eg:

input string

揌ello%Wor;ld?

?Piano!!!!!!!?

? Hi5&*^%# ?br>

but output should be like this

揌elloWorld?

揚iano?

揌i5?

[402 byte] By [6666a] at [2007-10-2 10:21:23]
# 1
http://forum.java.sun.com/thread.jspa?threadID=701242 http://forum.java.sun.com/thread.jspa?threadID=701243 http://forum.java.sun.com/thread.jspa?threadID=701283 http://forum.java.sun.com/thread.jspa?threadID=701288 http://forum.java.sun.com/thread.jspa?threadID=701289
prometheuzza at 2007-7-13 1:52:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

use this code effectively..u wil make it

<script language="JavaScript"><!--

var temp = new String('This is a test string... So? What...');

document.write(temp + '<br>');

temp = temp.replace(/[^a-zA-Z 0-9]+/g,'');

document.write(temp + '<br>');

//--></script>

gud luck

aleens

aleensa at 2007-7-13 1:52:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
hiu r given code working fine.Thanks
6666a at 2007-7-13 1:52:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

> hi

>

> u r given code working fine.

> Thanks

Ok, good for you.

Are you now going to post in all your other thread that you've found an answer?

Others might spend time in one of your other threads to answer you, while you don't need it anymore.

prometheuzza at 2007-7-13 1:52:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...