<div class="span12">
<form id="pdu_add_form" class="form-horizontal" action="javascript:void(0);" οnsubmit="javascript:doAdd();">
<div class="span12">
<div class="control-group span6">
<label class="control-label"><i class="required">*</i>PDU名称:</label>
<div class="controls">
<textarea name="pducode" rows="1" class="span11" required></textarea>
</div>
</div>
<div class="control-group span6">
<label class="control-label">服务名称:</label>
<div class="controls">
<textarea name="modulecode" rows="1" class="span11" required></textarea>
</div>
</div>
</div>
<div style="text-align:center"><button type="submit" class="btn btn-info">保存</button> </div>
</form>
</div>
1、button那里要写上 type="submit"
2、form表单要写上 οnsubmit="javascript:doAdd();"
3、
action="javascript:void(0);表示不跳转,否则会自动跳转到当前页面的get方法
4、doAdd()方法要写成全局方法,不要写在具体事件里,比如写在
$(document).ready(function(),是调用不到的。