相关疑难解决方法(0)

使用jQuery从隐藏字段中获取价值

我有一个<input type="hidden" value="" id='h_v' class='h_v'> 使用jQuery我想提醒用户这个值.

我在用

var hv = $('#h_v).text();
alert('x');
Run Code Online (Sandbox Code Playgroud)

但它不起作用,任何线索!

jquery

132
推荐指数
5
解决办法
41万
查看次数

如何通过javascript设置输入隐藏字段的值?

我试图调用resetyear函数,它也被调用,但流程停止在警报("结束"),它不会将其控制转移到resetmaster.请给我一些建议.

    String flag = "";
    flag = (String) session.getAttribute("flag");
    System.out.println("flag = " + flag);
    if (flag == null) {
        flag = "";
    }
    if (flag.equals("yes")) {
%>   
<script>

   alert(1);
  // resetyear();
    dontreset();
    //document.getElementById("checkyear").value = "1";
    //alert(document.getElementById("checkyear").value);

</script>
<%} else if(flag.equals("no"))
    {%>
<script>
    alert(2);
    //document.getElementById("checkyear").value = "2";
    //alert(document.getElementById("checkyear").value);
    resetyear();
</script>
<%}else{}%>


function resetyear(){

if(confirm("DO YOU WANT TO RESET THE YEAR?"))
{
    alert("hello");
    //document.forms['indexform'].action = "resetmaster";
    //alert(document.forms['indexform'].action);
    //document.forms['indexform'].submit();  
    alert("over");
    form.action = "resetmaster";
    form.submit();
    alert(1);
}
Run Code Online (Sandbox Code Playgroud)

html javascript hidden-field

33
推荐指数
3
解决办法
26万
查看次数

标签 统计

hidden-field ×1

html ×1

javascript ×1

jquery ×1