visible or not visible

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bindurajeesh

    #1

    visible or not visible

    I am using the following code to make a textbox visible if a certain item is
    selected from the dropdownlist box. On debug it appears to not even fire the
    selected index change module. What is wrong

    Private Sub ddlMedicalNeces sity_SelectedIn dexChanged(ByVa l sender As
    System.Object, ByVal e As System.EventArg s) Handles
    ddlMedicalNeces sity.SelectedIn dexChanged
    If ddlMedicalNeces sity.SelectedVa lue = "Other (please specify):" Then
    txtSpecify.Visi ble = True
    Else
    txtSpecify.Visi ble = False
    End If
    End Sub

    I want the textbox to appear only if other (please specify): is selected. I
    have tried taking the value of ddlmedicalneces sity.selectedva lue and put in a
    variable and then put the variable in if phrase but that does not work
    either. Thank you.
  • UsualDosage

    #2
    RE: visible or not visible

    Chances are the event is not configured in the HTML. There are two ways to
    possibly fix this:

    1) Ensure the "AutoPostBa ck" property is set to TRUE. If it is, and still
    doesn't work, see #2.

    2) Change the access for the method from Private to Publc. Click on the HTML
    tab, and find where the dropdownlist is declared. It should look like:
    <asp:DropDownLi st id="DropDownLis t1" runat="server"> </asp:DropDownLis t>. You
    will need to add the "OnSelectIndexC hanged" event handler. Make it look like:
    <asp:DropDownLi st id="DropDownLis t1"
    OnSelectIndexCh anged="ddlMedic alNecessity_Sel ectedIndexChang ed"
    runat="server"> </asp:DropDownLis t>

    Recompile and run, and it should work for you.
    --
    "Quae narravi, nullo modo negabo."


    "bindurajee sh" wrote:
    I am using the following code to make a textbox visible if a certain item is
    selected from the dropdownlist box. On debug it appears to not even fire the
    selected index change module. What is wrong
    >
    Private Sub ddlMedicalNeces sity_SelectedIn dexChanged(ByVa l sender As
    System.Object, ByVal e As System.EventArg s) Handles
    ddlMedicalNeces sity.SelectedIn dexChanged
    If ddlMedicalNeces sity.SelectedVa lue = "Other (please specify):" Then
    txtSpecify.Visi ble = True
    Else
    txtSpecify.Visi ble = False
    End If
    End Sub
    >
    I want the textbox to appear only if other (please specify): is selected. I
    have tried taking the value of ddlmedicalneces sity.selectedva lue and put in a
    variable and then put the variable in if phrase but that does not work
    either. Thank you.

    Comment

    • lmnorms1@yahoo.com

      #3
      Re: visible or not visible

      Shouldn't txSpecify.Refre sh be done after changing the value.


      UsualDosage wrote:
      Chances are the event is not configured in the HTML. There are two ways to
      possibly fix this:
      >
      1) Ensure the "AutoPostBa ck" property is set to TRUE. If it is, and still
      doesn't work, see #2.
      >
      2) Change the access for the method from Private to Publc. Click on the HTML
      tab, and find where the dropdownlist is declared. It should look like:
      <asp:DropDownLi st id="DropDownLis t1" runat="server"> </asp:DropDownLis t>. You
      will need to add the "OnSelectIndexC hanged" event handler. Make it look like:
      <asp:DropDownLi st id="DropDownLis t1"
      OnSelectIndexCh anged="ddlMedic alNecessity_Sel ectedIndexChang ed"
      runat="server"> </asp:DropDownLis t>
      >
      Recompile and run, and it should work for you.
      --
      "Quae narravi, nullo modo negabo."
      >
      >
      "bindurajee sh" wrote:
      >
      I am using the following code to make a textbox visible if a certain item is
      selected from the dropdownlist box. On debug it appears to not even fire the
      selected index change module. What is wrong

      Private Sub ddlMedicalNeces sity_SelectedIn dexChanged(ByVa l sender As
      System.Object, ByVal e As System.EventArg s) Handles
      ddlMedicalNeces sity.SelectedIn dexChanged
      If ddlMedicalNeces sity.SelectedVa lue = "Other (please specify):" Then
      txtSpecify.Visi ble = True
      Else
      txtSpecify.Visi ble = False
      End If
      End Sub

      I want the textbox to appear only if other (please specify): is selected. I
      have tried taking the value of ddlmedicalneces sity.selectedva lue and put in a
      variable and then put the variable in if phrase but that does not work
      either. Thank you.

      Comment

      • bindurajeesh

        #4
        RE: visible or not visible

        #1 did the trick thank you

        "UsualDosag e" wrote:
        Chances are the event is not configured in the HTML. There are two ways to
        possibly fix this:
        >
        1) Ensure the "AutoPostBa ck" property is set to TRUE. If it is, and still
        doesn't work, see #2.
        >
        2) Change the access for the method from Private to Publc. Click on the HTML
        tab, and find where the dropdownlist is declared. It should look like:
        <asp:DropDownLi st id="DropDownLis t1" runat="server"> </asp:DropDownLis t>. You
        will need to add the "OnSelectIndexC hanged" event handler. Make it look like:
        <asp:DropDownLi st id="DropDownLis t1"
        OnSelectIndexCh anged="ddlMedic alNecessity_Sel ectedIndexChang ed"
        runat="server"> </asp:DropDownLis t>
        >
        Recompile and run, and it should work for you.
        --
        "Quae narravi, nullo modo negabo."
        >
        >
        "bindurajee sh" wrote:
        >
        I am using the following code to make a textbox visible if a certain item is
        selected from the dropdownlist box. On debug it appears to not even fire the
        selected index change module. What is wrong

        Private Sub ddlMedicalNeces sity_SelectedIn dexChanged(ByVa l sender As
        System.Object, ByVal e As System.EventArg s) Handles
        ddlMedicalNeces sity.SelectedIn dexChanged
        If ddlMedicalNeces sity.SelectedVa lue = "Other (please specify):" Then
        txtSpecify.Visi ble = True
        Else
        txtSpecify.Visi ble = False
        End If
        End Sub

        I want the textbox to appear only if other (please specify): is selected. I
        have tried taking the value of ddlmedicalneces sity.selectedva lue and put in a
        variable and then put the variable in if phrase but that does not work
        either. Thank you.

        Comment

        Working...