$("form input[type=text]").each(function () {
});
this.value=$.trim(this.value);
$(document).ready(function (){//通用方法去输入框前后空格
$("form").on("change",function () {
$("form input[type=text]").each(function () {
this.value=$.trim(this.value);
});
})
});
});