文本框值无法读取 [英] textbox value cannot read

查看:86
本文介绍了文本框值无法读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了javascript.Value来自这个javascript我填充textbox.textbox现在填充值(例如:200)但是问题是..当这个文本框被禁用时,其中的值无法插入到database.if文本框中是没有禁用然后值插入数据库。

i必须执行textbox disable并将值插入database.how我可以这样做吗?

解决方案

< blockquote>请将textbox属性设置为 readonly 。如果您已禁用 Textbox属性,则无法读取该值。 />


谢谢


如果您可以分享有关何时输入数据以及何时禁用数据的详细信息,那将会很棒。 ..但是根据你提供的信息......我会说



维护一个隐藏文本字段,可以捕获禁用字段中的数据,并使用隐藏字段检索数据。


,因为你已经使用javascript设置了它的值,你将需要ired使用以下方式获取价值



  string  myValue =请求[  txt_totalfees]。ToString(); 


i have used javascript.Value from this javascript i have fill textbox.textbox is now fill with value(Ex:200) But problem is ..when this textbox is disable,value in it cannot be inserted into database.if textbox is not disable then value is insert in database.
i have to do textbox disable and insert value into database.how i can do this?

解决方案

Please make the textbox property to readonly.If you disabled the Textbox property the value cannot be read.

Thanks


It will be great if you could share little more details about when you are inputing data and when you disable it.... but based on the info you provided.. I would say

Maintain a hidden text field which can capture the data from disabled field, and use the hidden field for retrieving data.


since you have set its value using javascript you will be required to use the following way to get the value

string myValue = Request["txt_totalfees"].ToString();


这篇关于文本框值无法读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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