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

121
Views
When a datatable (jquery) has data after getting filtered, make a label visible

I have a DataTable (jQuery) that currently allows me to filter my data when I enter a string inside an input field. By default, a label is invisible.

After filtering, I want to be able to make a the label visible if the the dataTable after filtering contains data. Vice versa, if the dataTable is empty after filtering, I want the label to stay invisible.

I am relatively new to web-development so please excuse my lack of knowledge. The filtering of the datatables is client-side so im a but unsure on how to achieve this.

this is how i initialised the datatable

if the filter results in an empty dataTable, no label should appear

if the filter results in a datatable with data, a label should appear

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You need to add a change event listener to your input field. Afterwards just check if the field content meets the required conditions and set the label's display style to style properties like

document.getElementById(labelname).style.display = 'none'
about 4 years ago · Juan Pablo Isaza Report
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!