如何获得input隐藏域传值中的值

君,已阅读到文档的结尾了呢~~
html中隐藏域hidden的作用介绍及使用示例
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
html中隐藏域hidden的作用介绍及使用示例
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer-4.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
阅读(5565)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_',
blogTitle:'jquery点击链接给hidden隐藏域赋值',
blogAbstract:'jquery可以用 $(\"#id\")来获取元素,其后用$(\"#id\").val(xxx)来设置value值
&&&&&& &a onclick=\"$(\'#city\').val(3);formSubmit();\"&{/if}& href=\"#\"&北京&/a&
&&&&&& &input type=\"hidden\" name=\"city\'\" id=\"city\'\" &',
blogTag:'jquery,hidden,赋值',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:0,
publishTime:6,
permalink:'blog/static/',
commentCount:1,
mainCommentCount:1,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'',
hmcon:'0',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}不提交&&JS&获取form&里面隐藏域的值
name="form"&&volist name="coopers"
id="csvo"&&input type="hidden"
name="ids" value="{$csvo.attachment}"
/&&/volist&&volist
name="coopers1" id="csvo1"&&input
type="hidden" name="ids1" value="{$csvo1.attachment}"
/&&/volist&&volist
name="coopers2" id="csvo2"&&input
type="hidden" name="ids2" value="{$csvo2.attachment}"
/&&/volist&&/form&
&script type="text/javascript"&
var attachment=document.form.ids.
var attachment1=document.form.ids1.
var attachment2=document.form.ids2.
&var focus_width=320
&var focus_height=235
&var text_height=0
&var swf_height = focus_height+text_height
imgtext1="蔬菜广告创意01"
imgLink1=escape("http://");
imgUrl2=attachment1;
imgtext2="蔬菜广告创意02"
imgLink2=escape("http://");
imgUrl3=attachment2;
imgtext3="蔬菜广告创意03"
imgLink3=escape("http://");
&var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3
links=imgLink1+"|"+imgLink2+"|"+imgLink3
texts=imgtext1+"|"+imgtext2+"|"+imgtext3
&document.write('&object
classid="clsid:d27cdb6e-ae6d-11cf-96b8-"
codebase=""
width="'+ focus_width +'" height="'+ swf_height
&document.write('&param
name="allowScriptAccess"
value="sameDomain"&&param
name="movie"
value="../Public/images/focus1.swf"&&param
name="quality" value="high"&&param
name="bgcolor" value="#F0F0F0"&');
&document.write('&param name="menu"
value="false"&&param name=wmode
value="opaque"&');
&document.write('&param
name="FlashVars"
value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'"&');
&document.write('&/object&');
&&/script&
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。html中隐藏域hidden的作用介绍及使用示例
作者:佚名
字体:[ ] 来源:互联网 时间:08-26 18:08:59
隐藏域在页面中对于用户是不可见的,在表单中插入隐藏域的目的在于收集或发送信息,以利于被处理表单的程序所使用,下面为大家详细介绍下此隐藏域在实际中时如何使用的,感兴趣的朋友不要错过了哈
基本语法: &input type=&hidden& name=&field_name& value=&value&& 作用: 1 隐藏域在页面中对于用户是不可见的,在表单中插入隐藏域的目的在于收集或发送信息,以利于被处理表单的程序所使用。浏览者单击发送按钮发送表单的时候,隐藏域的信息也被一起发送到服务器。 2 有些时候我们要给用户一信息,让他在提交表单时提交上来以确定用户身份,如sessionkey,等等.当然这些东西也能用cookie实现,但使用隐藏域就简单的多了.而且不会有浏览器不支持,用户禁用cookie的烦恼。 3 有些时候一个form里有多个提交按钮,怎样使程序能够分清楚到底用户是按那一个按钮提交上来的呢?我们就可以写一个隐藏域,然后在每一个按钮处加上onclick=&mand.value=&xx&&然后我们接到数据后先检查command的值就会知道用户是按的那个按钮提交上来的。 4 有时候一个网页中有多个form,我们知道多个form是不能同时提交的,但有时这些form确实相互作用,我们就可以在form中添加隐藏域来使它们联系起来。 5 javascript不支持全局变量,但有时我们必须用全局变量,我们就可以把值先存在隐藏域里,它的值就不会丢失了。 6 还有个例子,比如按一个按钮弹出四个小窗口,当点击其中的一个小窗口时其他三个自动关闭.可是IE不支持小窗口相互调用,所以只有在父窗口写个隐藏域,当小窗口看到那个隐藏域的值是close时就自己关掉。 例子: 使用hidden实现点击提交按钮数字加1 数值自增.htm 代码如下: &form action="数值自增.ashx" method="post"& &input type="hidden" name="_viewstate" value="a" /& &input type="hidden" name="_div" value="@n" /& &!-- &input name="txt" type="text" value="@value" /&--& &div&@n&/div& &input type="submit" value="click" /& &/form& 使用一般处理程序实现 数值自增.ashx 代码如下: int n = 0; public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/html"; string path = context.Request.MapPath("数值自增.htm"); string html = System.IO.File.ReadAllText(path); //判断页面是否是第一次加载 string viewstate = context.Request.Form["_viewstate"]; if (!string.IsNullOrEmpty(viewstate)) { //点击按钮 post //获取隐藏域的值 string s = context.Request.Form["_div"]; if (int.TryParse(s, out n)) { n++; html = html.Replace("@n",n.ToString()); } } else { //页面首次加载,给div和div对应的隐藏域赋值 html = html.Replace("@n", n.ToString()); } context.Response.Write(html); }
大家感兴趣的内容
12345678910
最近更新的内容}

我要回帖

更多关于 隐藏域传值 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信