Useful Javascript Code

This function will remove any characters or punctuation which is not allowed in input.

<script language="javascript">
function test(){
var kwd = document.getElementById("kwd");
kwdv = kwd.value.replace(/[^\d\w\.\?\_\=\&\:\\]/g,'');
alert(kwdv);
}
</script>

<input type="text" value="" name="kwd" id="kwd" onblur="test()">
affiliate_link
Share this Post:
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

No Responses to “Useful Javascript Code”

Leave a Reply:

Name (required):
Mail (will not be published) (required):
Website:
Comment (required):
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>