element-form.js元素获取表单值
<form id="myForm" action="submit.php">
<input name="email" value="bob@bob.com">
<input name="zipCode" value="90210">
</form> <script> $('myForm').toQueryString()
</script>
1、很简单的方法,就是使用$('myForm')已经输入好了的数据,转换成QueryString查询字符串,然后不通过提交表单的同步方法,而是采取ajax的异步方法post发出表单数据,获取服务器响应的文本数据。
2、getValue
Returns the value of the Element, if its tag is textarea,
select or input. getValue called on a multiple select will
return an array.
如果html标签是textarea文本域,select下拉菜单,或者 input。那么getValue会将这些表单元素的值以一个数组形式,返回给函数。