表单提交去空格:
function textFieldTrim(){
var elems = document.getElementsByTagName("input");
for(var i=0; i<elems.length; i++){
var elem = elems[i];
if(elem.value){
elem.value = elem.value.replace(/(^\s*)|(\s*$)/g,'');
}
}
}