[CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Filter value</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> select{margin:5px 10px;padding:3px 7px 3px 5px;border:none;} div#content{text-align:center;padding-top:100px;} </style> <script type="text/javascript"> function filter_value(){ var txt = document.getElementById('inp').value; var unwanted = /www./ig; /* var unwanted = /(http://)?www./ig; use this if you want to remove http:// aswell */ document.getElementById('inp').value = txt.replace(unwanted, ''); /* the two lines below are just for testing remove them and uncomment the last line */ document.getElementById('result').innerHTML = document.getElementById('inp').value; return false; //document.getElementById(your_posting_form_id).submit(); }
function set_posting_form(){ document.getElementById('p_f').onsubmit = filter_value; }