asp.net / jscript question regarding checkbox and post back

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Johann Lee
    New Member
    • Mar 2011
    • 1

    asp.net / jscript question regarding checkbox and post back

    Code:
    function setCheckBox(checkedvalue) {
            //document.getElementById("MMainBody_MTMWTWDTDHF").value = "test";
            //setValue("<%=checkvalueHF.ClientID %>", checkedvalue);
            if (checkedvalue == "false") {
                setValue("<%=ReasonHF.ClientID %>", "noadjust");
            }
            else {
                setValue("<%=ReasonHF.ClientID %>", "All");
            }
            document.forms[0].submit();
        }

    that's my code, works fine with you check on the checkbox, it changes the data its pulling, but when you uncheck it, the data stays the same and refreshing says it will repost, but still keeps same data as if it is checked. only if i hit my reset button,

    <asp:Button ID="ResetBtn" runat="server" Text="Reset" OnClick="ResetB tn_Clicked"/>

    does it go back to the original data. what is a way within jscript to get the page to recognize that the box has been unchecked?
    Last edited by Stewart Ross; Mar 31 '11, 11:09 PM. Reason: added code tags around code segment
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    I'm not entirely clear about your question.
    I'm not even sure what the JavaScript does that you've posted.

    Could you please explain more about your application.

    Is the problem happening client side or server side?

    -Frinny

    Comment

    Working...