Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

273
Views
Hide div with javascript after page loads based on ASPxComboBox after page load from database from code behind

I have an aspx page that contains an ASPxComboBox. When this combo is changed after the page loads the div hides/unhides fine. In my case I load existing values from the database. I need to hide/show div based on these loaded values. If I populate the dropdown with "None" I want to hide the divs. Thanks.

< script type = "text/javascript" >
  function OnSizeChanged(cbSide) {
    const str = cbSide.GetText().toString();
    if (str.includes('None')) {
      bottomtext.style.display = "block";
      lblbottomtext.style.display = "block";
    } else {
      lblbottomtext.style.display = "none";
      bottomtext.style.display = "none";
    }
  } 
  </script>
<dx:ASPxComboBox ID="cbSide" runat="server" Width="280" ValueType="System.String">
  <Items>
    <dx:ListEditItem Text="DXF" Value="DXF" />
    <dx:ListEditItem Text="None" Value="None" />
  </Items>

  <ClientSideEvents SelectedIndexChanged="function(s, e) { OnSizeChanged(s); }" />
  <ValidationSettings RequiredField-IsRequired="true" Display="Dynamic">
    <RequiredField IsRequired="True"></RequiredField>
  </ValidationSettings>
</dx:ASPxComboBox>

<div id="lblbottomtext" runat="server">
  <dx:ASPxLabel ID="lblBST" runat="server" Text="Bottom Side Text:"></dx:ASPxLabel>
</div>
<div id="bottomtext" runat="server">
  <dx:ASPxMemo ID="txtBottom" runat="server" Height="71px" Width="280px"></dx:ASPxMemo>
</div>

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!