function seo_string(field_name,str,dirlist,dirchk) { dir_pat=RegExp("^("+dirlist.replace(/,/g,"|")+")$","i"); dir_str=dirlist.replace(/,/g,", "); // if(str.match(/^[^a-zA-Z]|[^a-zA-Z0-9_\-]|[^a-zA-Z]$/)) if(str.match(/[&\/\? \.]/)) return (''+field_name+' must not contain &/? . characters'); else if(dirchk==true && str.match(dir_pat) ) return ('This value of '+field_name+' is not allowed. Try appending / removing some characters to the value'); else return false; } function sbconvert_toseo(title,seo) { a=title.value.replace(/^[^a-zA-Z]+/,""); a=a.replace(/[^a-zA-Z0-9_\-]+/g,"_"); a=a.replace(/[^a-zA-Z]+$/,""); seo.value=a; }