通过Onchange概念重置的问题 [英] Problem in reset over a Onchange concept

查看:60
本文介绍了通过Onchange概念重置的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面,我粘贴了jsp代码.实际上,我面临的问题如下所示:实际结果:1.当我从计划事件类型"中选择下拉列表(即基于时间的计划)时,以下下拉参数说明应处于隐藏状态.如果当我从Schedule Event Type中选择下拉列表(即基于时间的时间表除外)时,则以下下拉列表即Parameter Description应该处于显示状态.

但是我面临的问题是在重置按钮.假设认为我已通过选择Schedule Event Type的下拉列表作为基于时间的时间表保存了一条记录,因此下面的下拉列表,即Parameter Description处于隐藏状态.然后我编辑该记录,并选择时间表事件类型"的下拉列表作为基于时间的时间表"之外的其他列表,因此以下下拉列表即参数说明"应处于显示状态.当我单击重置按钮时,下拉列表即参数描述不会隐藏状态.所以请帮我怎么做..........




Below i have pasted jsp code. Actually the problem that i''m facing is as informed below Actual result: 1. When i select a dropdown list i.e Time Based schedule from the Schedule Event Type, The below dropdown Parameter Description should be in hide state. If when i select dropdown list i.e other than Time Based schedule from the Schedule Event Type, The below dropdown i.e Parameter Description should be in show state.

But the problem that i''m facing is in reset button. Suppose think that i have saved a record by select dropdown list of the Schedule Event Type as Time Based schedule so the below dropdown list i.e Parameter Description is in hide state. And i edit that record and i select dropdown list of the Schedule Event Type as other than Time Based schedule so the below dropdown i.e Parameter Description should be in show state. And when i click on reset button the dropdown i.e Parameter Description is not going to hide state. So please help me how to that..........




<script>
function checking(obj)
{
    var row = document.getElementById("paramDisc");
    if(obj ==1){
    document.ScheduleEventForm.paramCode.value="";
    row.style.display = ''none'';
    }else{
    row.style.display = '''';
    }
}
function validate()
{
    if(document.ScheduleEventForm.assetMasterId.value ==""){
        alert("Please select the Asset Name.");
        document.ScheduleEventForm.assetMasterId.focus();
        return false;
    }

    if(document.ScheduleEventForm.eventType.value ==""){
        alert("Please select the Schedule Event Name.");
        document.ScheduleEventForm.eventType.focus();
        return false;
    }

    if(document.getElementById("eventType").value != 1 && document.ScheduleEventForm.paramCode.value ==""){
        alert("Please select the Parameter Description.");
        return false;
    }

}
</script>   



<tr>
            <td width="27%">
            <div align="right">Schedule Event Type<bean:message key="Form.RequiredSymbol"/></div>
            </td>
            <td width="73%"><span class="spacing"><html:select property="eventType" value=''<%=scheduleEvent.getEventType()+""%>''  styleClass="comboboxstye"  önchange="checking(this.options[this.selectedIndex].value);"> 
            <html:option value="">----Select----</html:option>
            <html:option value="1">Time Based schedule</html:option>
            <html:option value="2">Operation Based Schedule</html:option>
            <html:option value="3">Fault Based Schedule</html:option>
            </html:select>
            </span></td>
        </tr>

        <tr id="paramDisc">
            <td width="27%">
            <div align="right">Parameter Description<bean:message key="Form.RequiredSymbol"/></div>
            </td>
            <td width="73%"><span class="spacing"><html:select property="paramCode" styleClass="comboboxstye" value=''<%=scheduleEvent.getParamCode()+""%>''>
            <html:option value="">----Select----</html:option>
            <html:optionsCollection name="parameterMappingList" value="param_code" label="param_disp_name" />
            </html:select></span></td>
        </tr>
        <html:hidden property="scheduleEventId" value=''<%=scheduleEvent.getScheduleEventId()+""%>''/>

        <tr>
            <td> </td>
            <td><span class="spacing"><span> <input
                id="button" type=submit value="Save" name=save class="btn" /> </span></span><span
                class="spacing"><span> <input type=reset
                value="Reset" name=Reset class="btn" /> </span></span></td>
        </tr>

推荐答案

您需要处理RESET按钮的onreset()事件.
you need to handle the onreset() event of the RESET button.


这篇关于通过Onchange概念重置的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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