Repost: Manipulating save button based on readonly attribute

Discussion in 'ASP General' started by Jack, Jun 22, 2005.

  1. Jack

    Jack Guest

    Hi,
    I am trying to use the following code to make the save button invisible in
    the asp form when the checkbox is either on or the session variable has a
    particular value.
    THE CODE IS AS FOLLOWS:

    <%If ( cbool(l_IsChecked) = "FALSE" ) or (session("sess_FiscalFirst") <>
    "Y") then%>
    <input type="submit" value="Save" name="btn_Save">

    <%End If%>

    In the above, my logic is if the value of the checkbox is not true or the
    value of the session variable is not Y then only show the SAVE button.
    However this is not happening. I find that when the second part or the first
    part is not there, the logic goes fine i.e. the logic holds with only the
    first condition or the second condition itself but not with the or syntax.
    Not sure why. Any help is appreciated. Thanks.
    Jack, Jun 22, 2005
    #1
    1. Advertising

  2. Jack

    JitGanguly Guest

    Take the double quotes off from FALSE and try

    <%If ( cbool(l_IsChecked) = FALSE ) or (session("sess_FiscalFirst") <>
    "Y") then%>
    <input type="submit" value="Save" name="btn_Save">


    "Jack" wrote:

    > Hi,
    > I am trying to use the following code to make the save button invisible in
    > the asp form when the checkbox is either on or the session variable has a
    > particular value.
    > THE CODE IS AS FOLLOWS:
    >
    > <%If ( cbool(l_IsChecked) = "FALSE" ) or (session("sess_FiscalFirst") <>
    > "Y") then%>
    > <input type="submit" value="Save" name="btn_Save">
    >
    > <%End If%>
    >
    > In the above, my logic is if the value of the checkbox is not true or the
    > value of the session variable is not Y then only show the SAVE button.
    > However this is not happening. I find that when the second part or the first
    > part is not there, the logic goes fine i.e. the logic holds with only the
    > first condition or the second condition itself but not with the or syntax.
    > Not sure why. Any help is appreciated. Thanks.
    JitGanguly, Jun 22, 2005
    #2
    1. Advertising

  3. Jack

    Jack Guest

    Thanks for your help Jit. Howver, it did not work with the changes that you
    recommended. Regards.

    "JitGanguly" wrote:

    > Take the double quotes off from FALSE and try
    >
    > <%If ( cbool(l_IsChecked) = FALSE ) or (session("sess_FiscalFirst") <>
    > "Y") then%>
    > <input type="submit" value="Save" name="btn_Save">
    >
    >
    > "Jack" wrote:
    >
    > > Hi,
    > > I am trying to use the following code to make the save button invisible in
    > > the asp form when the checkbox is either on or the session variable has a
    > > particular value.
    > > THE CODE IS AS FOLLOWS:
    > >
    > > <%If ( cbool(l_IsChecked) = "FALSE" ) or (session("sess_FiscalFirst") <>
    > > "Y") then%>
    > > <input type="submit" value="Save" name="btn_Save">
    > >
    > > <%End If%>
    > >
    > > In the above, my logic is if the value of the checkbox is not true or the
    > > value of the session variable is not Y then only show the SAVE button.
    > > However this is not happening. I find that when the second part or the first
    > > part is not there, the logic goes fine i.e. the logic holds with only the
    > > first condition or the second condition itself but not with the or syntax.
    > > Not sure why. Any help is appreciated. Thanks.
    Jack, Jun 22, 2005
    #3
  4. Jack

    JitGanguly Guest

    Ok Jack. Thats means its not meetign the conditions.Remember 1 false+1 true
    would give you false , only a true, trur will give you true.So make sure the
    values are right by doign a response.write

    "Jack" wrote:

    > Thanks for your help Jit. Howver, it did not work with the changes that you
    > recommended. Regards.
    >
    > "JitGanguly" wrote:
    >
    > > Take the double quotes off from FALSE and try
    > >
    > > <%If ( cbool(l_IsChecked) = FALSE ) or (session("sess_FiscalFirst") <>
    > > "Y") then%>
    > > <input type="submit" value="Save" name="btn_Save">
    > >
    > >
    > > "Jack" wrote:
    > >
    > > > Hi,
    > > > I am trying to use the following code to make the save button invisible in
    > > > the asp form when the checkbox is either on or the session variable has a
    > > > particular value.
    > > > THE CODE IS AS FOLLOWS:
    > > >
    > > > <%If ( cbool(l_IsChecked) = "FALSE" ) or (session("sess_FiscalFirst") <>
    > > > "Y") then%>
    > > > <input type="submit" value="Save" name="btn_Save">
    > > >
    > > > <%End If%>
    > > >
    > > > In the above, my logic is if the value of the checkbox is not true or the
    > > > value of the session variable is not Y then only show the SAVE button.
    > > > However this is not happening. I find that when the second part or the first
    > > > part is not there, the logic goes fine i.e. the logic holds with only the
    > > > first condition or the second condition itself but not with the or syntax.
    > > > Not sure why. Any help is appreciated. Thanks.
    JitGanguly, Jun 23, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Learning SQL Server
    Replies:
    2
    Views:
    2,477
    Learning SQL Server
    Aug 7, 2003
  2. Matt
    Replies:
    1
    Views:
    4,166
  3. Matt
    Replies:
    2
    Views:
    19,040
  4. Jonathan Hyatt
    Replies:
    1
    Views:
    1,915
    Jonathan Hyatt
    Jun 8, 2004
  5. Jack
    Replies:
    1
    Views:
    181
    JitGanguly
    Jun 22, 2005
Loading...

Share This Page