easyUi --修改
来源:互联网 发布:景观设计软件有哪些 编辑:程序博客网 时间:2024/06/09 19:53
<style> #add{ padding: 8px; } #add table{ width:100%; border-collapse: collapse; border-color: #D4D4D4; border:0px; } #add table tr{ height: 30px; line-height: 30px; } #add table th{ text-align: center; color: #777; width:100px; } #add table td{ padding: 4px 10px; } .isshow{ position: relative; top:-6px; outline: none; } .show{ position: relative; top:1px; } .textbox{ height: 20px; line-height: 20px; padding: 2px; outline: none; } .textbox-addon { position: absolute; top: 2px; } #submit{ margin-left: 30px; } input[name=display]{ position: relative; top: 4px; } /* 图片上传样式 */ #file{ margin: 0; position: absolute; top:7px; left: 10px; } /* 图片上传样式结束 */</style><script> $(function(){ /* 图片上传 */ $("#file").uploadify({ swf:ThinkPHP['UPLOADIFY']+'/uploadify.swf', uploader:ThinkPHP['MODULE']+'/Uploads/upload', width:100, height:25, buttonCursor:'pointer', buttonText:'上传图片', fileTypeDesc:'图片类型', fileTypeExts:'*.jpeg; *.jpg; *.png; *.gif;', fileSizeLimit:'1MB', overrideEvents:['onSelectError','onDialogClose','onSelect'], //覆盖错误提示和上传列表 onSelectError:function (file,errorCode,errorMsg) { //上传超出限制 switch (errorCode){ case -110: $.messager.alert('警告','超出图片限制!','warning'); break; } }, onUploadStart:function () { //再上传之前的动作 $.messager.progress(); }, onUploadSuccess:function (file,data,response) { //图片上传成功后的方法 $.messager.progress('close'); $(".brandImg").attr('src',ThinkPHP['ROOT']+'/'+data); $('.imageUrl').append('<input type="hidden" name="image" value='+data+' />'); } }); /* 图片上传结束 */ /* 验证表单信息 */ checkData(); function checkData() { $('#bname').validatebox({ required: true, missingMessage:'请输入商标名称' }); $('#url').validatebox({ required: true, missingMessage:'请输入商标链接' }); $('#sort').validatebox({ required: true, missingMessage:'请输入排序' }); $('#info').validatebox({ required: true, missingMessage:'请输入描述' }); } /* 验证表单信息结束 */ /* 提交数据 */ $("#submit").click(function(){ if( !$('#bname').validatebox('isValid') ){ $('#bname').focus(); return; } if( !$('#url').validatebox('isValid') ){ $('#url').focus(); return; } if( !$('#sort').validatebox('isValid') ){ $('#sort').focus(); return; } if( !$('#info').validatebox('isValid') ){ $('#info').focus(); return; } //保存图片路径 $.ajax({ url:ThinkPHP['MODULE']+'/Brand/edit', type:'post', data:{ bid:$('#bid').val(), bname:$('#bname').val(), image:$('input[name=image]').val(), url:$("#url").val(), info:$("#info").val(), display:$("input[name=display]:checked").val(), sort:$("#sort").val() }, success:function(data){ if(data>0) { $('#tabs').tabs('close', '修改商标');//关闭当前tabs $('#brand').datagrid('reload');//刷新分类数据表格 $.messager.show({ title: '我的消息', msg: '修改成功', timeout: 1000, showType: 'slide' }); }else{ $('#tabs').tabs('close', '修改商标');//关闭当前tabs $('#brand').datagrid('reload');//刷新分类数据表格 $.messager.show({ title: '我的消息', msg: '修改失败', timeout: 1000, showType: 'slide' }); } } }); }); /* 提交数据结束 */ });</script><form id="add" data-options="iconCls:'icon-building_add'"> <input id="bid" type="hidden" name="bid" value="{$datas.bid}"> <table border="1"> <tr> <th>商标名称</th> <td> <input type="text" name="bname" id="bname" value="{$datas.bname}" class="textbox reset"> </td> </tr> <tr> <th>上传图片</th> <td style="position: relative; height: 30px;"> <input type="file" id="file" /> </td> </tr> <tr> <th>商标图片</th> <td class="imageUrl"> <img class="brandImg" src="__ROOT__/{$datas.image}" style="vertical-align: top;"/> </td> </tr> <tr> <th>商标链接</th> <td> <input type="text" id="url" class="textbox" name="url" value="{$datas.url}"> </td> </tr> <tr> <th>是否显示</th> <td> <label for="xs" >显示</label><input id="xs" type="radio" name="display" value="1" <if condition="$datas['display'] eq 1">checked</if> > <label for="yc" >隐藏</label><input id="yc" type="radio" name="display" value="0" <if condition="$datas['display'] eq 0">checked</if> > </td> </tr> <tr> <th>排序</th> <td> <input type="text" name="sort" id="sort" class="textbox" value="{$datas.sort}" /> </td> </tr> <tr> <th>商标描述</th> <td> <textarea class="textbox" id="info" style="width:385px;height: 140px;" >{$datas.info}</textarea> </td> </tr> <tr> <td colspan="2"> <a id="submit" data-options="iconCls:'icon-accept'" href="javascript:void(0);" class="easyui-linkbutton">修改商标</a> </td> </tr> </table></form>
0 0
- easyUi --修改
- EasyUI日期格式修改
- easyUi 修改页面
- easyui的修改
- easyui修改入门
- easyUI 日期控件修改...
- easyui dialog 修改title
- easyui combotree 高度修改
- easyui datagrid 动态修改表头
- easyui 动态修改窗口title
- EasyUi---datagird 行数据修改
- 【EasyUi DataGrid】批量修改提交
- easyui calendar修改显示周
- easyUI datagrid editor 修改 type
- easyui 中怎么修改主题
- easyui 动态修改窗口title
- EasyUI修改英文为中文
- EasyUI dateGrid修改单元格值
- turtlebot(hydro)学习笔记七:ASUS Xtion pro live替换kinect
- hdu1495非常可乐(BFS)
- mysql tcp 4层负载
- 表连接 join和(+)、union和uion all
- http-server 超轻量级web服务器
- easyUi --修改
- 阻塞、非阻塞、异步、同步以及select/poll和epoll
- CodeForces - 96B Lucky Numbers (easy)
- 轻量级Java EE企业应用实战 学习笔记(一)第一章
- sort与uniq
- 如何重置outlook
- 深度学习BP算法的推导附加RNN-LSTM的推导
- 测试用例与软件测试基础
- 励志学习文章精选