IE和Opera中隐藏的字段值无法正常维护 [英] Hidden field value not maintain properly in IE and Opera

查看:106
本文介绍了IE和Opera中隐藏的字段值无法正常维护的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ContentPlaceHolder中有三个隐藏字段

i使用jquery更新隐藏字段的值

示例: $(#ctl00_ContentPlaceHolder1_hidLikesValue)。val (fina.toString());

如果我发出警报,价值仍然存在

但我无法获得编码部分的价值

例如: string Likes = hidLikesValue.Value;

隐藏字段中没有值



这只发生在IE和Opeara,但完全在firefox中工作

i不知道为什么隐藏的字段值不能正确写入(IE,Opera)

请给出你的建议

I have three hidden fields in ContentPlaceHolder
i have update the value of hidden field using jquery for
example: $("#ctl00_ContentPlaceHolder1_hidLikesValue").val(fina.toString());
if i put alert the value is alive
but i cant get the value in codeing part
for example: string Likes = hidLikesValue.Value;
there is no value in hidden field

this is happening only in IE and Opeara, but perfectly working in firefox
i dont know why the hidden field value not properly writing in (IE,Opera)
Please give your suggestions

推荐答案

(#ctl00_ContentPlaceHolder1_hidLikesValue)。val(fina.toString());

如果我发出警报,价值仍然存在

但我无法获得编码部分的价值

例如: string Likes = hidLikesValue.Value;

隐藏字段中没有值



这只发生在IE和Opeara,但完全在firefox中工作

i不知道为什么隐藏的字段值不能正确写入(IE,Opera)

请给出你的建议
("#ctl00_ContentPlaceHolder1_hidLikesValue").val(fina.toString());
if i put alert the value is alive
but i cant get the value in codeing part
for example: string Likes = hidLikesValue.Value;
there is no value in hidden field

this is happening only in IE and Opeara, but perfectly working in firefox
i dont know why the hidden field value not properly writing in (IE,Opera)
Please give your suggestions


最后我给朋友们解答了答案,

i将隐藏的字段放在页面底部,

在IE中,歌剧从上到下执行代码所以首先执行脚本,然后只注册隐藏字段。

所以我把隐藏字段放在脚本部分之前,

所以现在首先注册隐藏字段然后脚本是运行

所以它可以完美地更新隐藏字段中的值。
finally i reveled the answer friends ,
i was put the hidden fields at bottom of the page,
in IE ,opera executing the code from top to bottom so the script executed first and then only hidden fields are registered.
so i put the hidden fields before the script part,
so now hidden fields are registered first and then script is running
so it can update the value in hidden field perfectly.


这篇关于IE和Opera中隐藏的字段值无法正常维护的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆