怎么获取使用jquery_confirm的input里面的内容

<!-- 新增表单 -->
<div id="createDialog" class="crudDialog" hidden>
    <form  id="dialog">
        <div class="form-group">
            <label >用户名</label>
            <input id="input1" type="text" class="form-control input-password">
        </div>
        <div class="form-group">
            <label for="input2">联系人编号</label>
            <input id="input2" type="text" class="form-control">
        </div>
        <div class="form-group">
            <label for="input3">姓名</label>
            <input id="input3" type="text" class="form-control">
        </div>
        <div class="form-group">
            <label for="input4">电话</label>
            <input id="input4" type="text" class="form-control">
        </div>
        <div class="form-group">
            <label for="input5">单位地址</label>
            <input id="input5" type="text" class="form-control">
        </div>
        <div class="form-group">
            <label for="input6">邮箱1</label>
            <input id="input6" type="text" class="form-control">
        </div>
        <div class="form-group">
            <label for="input7">邮箱2</label>
            <input id="input7" type="text" class="form-control">
        </div>
        <div class="form-group">
            <label for="input8">邮箱3</label>
            <input id="input8" type="text" class="form-control">
        </div>
    </form>
</div>

在使用jquery_confirm的框架时候,可以怎么获取表单里面input的数据呢?

1.如果你通过id去获取input里面的值,那么是行不通的,在html页面会有两个表单,一个是隐藏的表单还有一个是实际存在的。

2.如果你通过class去获取input里面的值,也是行不通的,class获取不到数据。

3.可以通过以下来获取页面input里面的值

	var name=this.$content.find('#input1').val();

可以通过find来获取。

function createAction() {
	$.confirm({
		type: 'dark',
		animationSpeed: 300,
		title: '新增用户',
		content: $('#createDialog').html(),
		buttons: {
			confirm: {
				text: '确认',
				btnClass: 'waves-effect waves-button',
				action: function () {
					
				}
			},
			cancel: {
				text: '取消',
				btnClass: 'waves-effect waves-button'
			}
		}
	});
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值