<div class="form-group"> <div class="label"> <label for="username"> 分类名称</label> </div> <div class="field"> <input type="text" class="input" id="edit_value" value="" size="50" data-validate="required:必填" /> </div> </div> <div class="form-group"> <div class="label"> <label for="username"> 分类标识</label> </div> <div class="field"> <input type="text" class="input" id="edit_name" value="" size="50" /> </div> </div> <div class="dialog-foot"> <button class="button dialog-close"> 取消</button> <input type="hidden" name="id" id="e_id" value=""/> <button class="button bg-green" id="type_edit_up"> 确认</button> </div>
$("button#type_edit_up").click(function(){ var type_id=$('input#e_id').val(); var value=$('input#edit_value').val(); var name=$('input#edit_name').val(); alert(value); return false; var self = $(this); layer.msg('正在修改中...', {icon: 16}); $.post("{#:U('type_edit')#}", {id:type_id,name:name,value:value},function(data){ if(data.status){ layer.msg(data.info,{time: 2000, icon:6}); setTimeout(function(){window.location=data.url;},1000); } else { layer.msg(data.info,{time: 2000, icon:5}); } }, "json"); });
点击确认,只能弹出input初始数据,而后期添加的无法获取
雅趣