本文介绍了我正在使用javascript在html文本框中存储一些值,我想将其存储到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<script type="text/javascript">

        function addthis(tid, val1) {
            if (tid.checked) {
                document.getElementById("resdiv").innerText = parseInt(document.getElementById("resdiv").value) + parseInt(val1);


            }
            else {
                document.getElementById("resdiv").innerText = parseInt(document.getElementById("resdiv").value) - parseInt(val1);
            }

        }


    </script>




< input type ="text" id ="resdiv" value ="0"/>

在代码C#中
我用过

session ["xyz"] = request.form ["resdiv"];这不起作用
我也用过runat ="server"但不能正常工作

任何解决方案




<input type="text" id="resdiv" value="0" />

in code C#
i used

session["xyz"] = request.form["resdiv"]; which is not working
i used runat = "server" also but not working

any solution

推荐答案

<input type="text"  runat="server" id="resdiv" />

<script type="text/javascript">
 
function addthis(tid, val1) 
{
 if (tid.checked) 
  {
  document.getElementById("resdiv").innerHTML = parseInt(document.getElementById("resdiv").value) + parseInt(val1);
  }
 else
  {
   document.getElementById("resdiv").innerHTML = parseInt(document.getElementById("resdiv").value) - parseInt(val1);
  }
}
 

    </script>




试试这个,它将起作用.




Try This , it will work .




这篇关于我正在使用javascript在html文本框中存储一些值,我想将其存储到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 16:50