小编Div*_*ang的帖子

如何通过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万
查看次数

jsp中的模态弹出窗口

我希望我的表单在单击生成按钮时显示一个弹出窗口。当弹出窗口显示时,背景应该会褪色。

下面是包含生成按钮的表单。

<table class="ds_box" cellpadding="0" cellspacing="0" id="ds_conclass" style="display: none;">
        <tr><td id="ds_calclass">
            </td></tr>
    </table>
    <form name="cashreciept" method="POST" action="/ColdStorage/cashreciept" id="cashreciept">

        <div id="maindiv" >
            <div align="center">
                <p>&nbsp;</p>
                <p id="Title" align="center">CHANDNA COLD STORAGE
                </p>
            </div><br>
            <p align="center" style="font-size: 21px">CASH RECIEPT</p>
            <fieldset>
                <legend>CASH RECIEPT DETAILS:</legend>
                <table width="823" height="146" border="0" cellpadding="10">
                    <tr>
                        <td width="155">AGREEMENT  NO.: </td>
                        <td width="272" height="56"><input type="text" name="agrno" id="agrno" placeholder="Agreement No" value ="<%=agrno%>" >
                            <input type="button" name="Fill Details" id="fill details" value="FILL DETAILS" width="10px" height="10px" onClick="javascript:submitcash()"></td>


                        <td width="124">RECIEPT NO.:</td>
                        <td width="182" height="56"><input type="text" name="Recieptno" …
Run Code Online (Sandbox Code Playgroud)

jquery jsp simplemodal modalpopups modalpopup

2
推荐指数
1
解决办法
1万
查看次数