Javascript to rename input text
===

i have this script to accept determinates characters on a input box, but i need a modify. I want accept from input box only letters, number and one blank space. How i can do?

    var r={
    'special':/[\W]/g,
    'quotes':/['\''&'\"']/g,
    'notnumbers':/[^\d]/g
    }

    function valid(o,w){
    o.value = o.value.replace(r[w],'');
    }

Regards