form表单中action的地址格式 “__URL__/edit/{xxx}”,大括号内的 “xxx” 就是变量名,主要功能是结合table组件一起使用。

下图中的删除、编辑、修改密码都是用了url变量替换:

删除、编辑、修改密码使用了变量{sid_user},特别需要注意的是变量命名的格式,必须以"sid_"开头,这样后台可以直接以变量"sid"接收。

<tbody>中<tr target="sid_user" rel="<%= value %>">

当选中一行时,tr上的rel值会自动替换到url变量中.

代码示例:

 <a class="delete" href="__URL__/foreverdelete/{sid_user}" target="ajaxTodo" title="你确定要删除吗?" warn="请选择用户"><span>删除</span></a>

 <a class="edit" href="__URL__/edit/{sid_user}" target="dialog" mask="true" warn="请选择用户"><span>编辑</span></a>

 <a class="icon" href="__URL__/password/{sid_user}" target="dialog" mask="true" warn="请选择用户"><span>修改密码</span></a>

 <table class="list" width="100%" layoutH="116">
<thead>
<tr>
<th width="60">编号</th>
<th width="100">用户名</th>
<th>昵称</th>
<th>Email</th>
<th width="100">添加时间</th>
<th width="120">上次登录</th>
<th width="80">登录次数</th>
<th width="80">状态</th>
</tr>
</thead>
<tbody>
<volist id="vo" name="list">
<tr target="sid_user" rel="<%= id %>">
<td><%= id %></td>
<td><%= account %></td>
<td><%= nickname %></td>
<td><%= email %></td>
<td><%= create_time %></td>
<td><%= last_login_time %></td>
<td><%= login_count %></td>
<td><%= status %></td>
</tr>
</volist>
</tbody>
</table>

注意: url变量名{sid_user}和tr的target="sid_user"保持一致.

在最近的工作过程中,发现一个bug,我将form表单的action写成了“ action='#' ”,通过js事件来改变action的值,但是如果不选择列表项直接点击新增或删除按钮时,页面不能正常提示“请选择信息”的提示,而是直接在弹出层内加载了首页,后来经过领导的指点才发现就是因为我写的action的原因;后来为了保证js动态改变action地址的同时实现弹出提醒信息的功能,我之间将action的值默认为“action={sid_user}”的格式,最后实现了预先的需求。

dwz的form表单中url的变量替换的更多相关文章

  1. Form表单中method为get和post的区别

    序,form表单中的方法分为get和post,但你都知道他们之间的区别吗? Form表单中method为get和post的区别: 例子如下,有个Form表单. <form action=&quo ...

  2. Form表单中的action路径问题,form表单action路径《jsp--->Servlet路劲问题》这个和上一个《jsp--->Servlet》文章有关

    Form表单中的action路径问题,form表单action路径 热度5 评论 50 www.BkJia.Com  网友分享于:  2014-08-14 08:08:01     浏览数44525次 ...

  3. 今天在研究jquery用ajax提交form表单中得数据时,学习到了一种新的提交方式

    今天在研究jquery用ajax提交form表单中得数据时,学习到了一种新的提交方式 jquery中的serialize() 方法 该方法通过序列化表单值,创建 URL 编码文本字符串 序列化的值可在 ...

  4. Form表单中的action路径问题

    今天刚接触web,在用jsp和servlet做一个简单的登陆的时候在Form表单action属性和method属性的一些问题:  我遇到的是Form表单提交到servelet处理时遇到的问题:  (1 ...

  5. Form表单中的action提交路径问题

    Form表单中的action提交路径问题 Form表单action属性和method属性的一些问题: 我遇到的是Form表单提交到servelet处理时遇到的问题:(1)<form name=& ...

  6. jQuery中设置form表单中action的值的方法

    下面介绍在jQuery中设置form表单中action的值的方法. $("#myFormId").attr("action", "userinfo.s ...

  7. jQuery中设置form表单中action值与js有什么不同。。。。

    jQuery中设置form表单中action值与js有什么不同.... HTML代码如下: <form action="" method="post" i ...

  8. jsp中的form表单中的 id和name有什么区别了

    <form action="./system/WebServer_webServerLogin" method="post" id="login ...

  9. Form 表单中的Input元素回车时不保存表单

    在Form表单中如果直接在Input元素里敲回车键,那么默认将提交表单,可以通过keydown事件取消默认此操作 $("form").live('keydown',function ...

随机推荐

  1. One Edit Distance

    Given two strings S and T, determine if they are both one edit distance apart. 分析:https://segmentfau ...

  2. ZigZag Conversion

    The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like ...

  3. 【转】WebMagic-总体流程源码分析

    转自:http://m.blog.csdn.net/article/details?id=51943601 写在前面 前一段时间开发[知了]用到了很多技术(可以看我前面的博文http://blog.c ...

  4. ios8 新增的 showViewController 和 showDetailViewController

    1.showViewController 先看看说明: You use this method to decouple the need to display a view controller fr ...

  5. ios 获得设备型号方法

    以前用UIScreen 的大小来判断设备类型,现在有了iphone6 和 iphone6 plus, 这种方法不能用了.因为当程序不提供相应的启动图片时,系统会把程序运行在320*568的size下, ...

  6. 安装m2crypto报错swig error : Unrecognized option -builtin

    M2Crypto 是最完整的为 Python 包装 OpenSSL 的 RSA,DSA,DH,EC,HMACs,消息摘要,对称密码算法(包括AES)的一个库工具.而自从 M2Crypto 升级到版本 ...

  7. MPlayer-2016-bin-noConsole

    运行 Install-RMenu.cmd 添加右键播放功能 ; 往前0.05秒 大概10多个帧 ' 往后0.05秒 大概10多个帧 鼠标右键 快速定位 鼠标中键 退出 F1 缩小 F2 原始大小 F3 ...

  8. jquery格式化时间

    使用方法: new Date().format("yyyy-MM-dd hh:mm:ss"); 格式: Date.prototype.format = function (form ...

  9. 【leetcode】Insert Interval(hard)★

    Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessa ...

  10. php面向对象加载类、常用设计模式

    加载类: include("./Ren.class.php"); include "./Ren.class.php"; 用此方法的时候include后面要加空格 ...