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

167
Views
How to if elase function for following?

I need help to create function to enable option disable other remaining options. For suppose id product price is fall between 5000 to 10000 then it allows to choose only option that has 5000 to 10000 and remain will disable and Price in between 10000 to 20000 and it only allow respictive option to choose. Options dom

option filed for user

Price of product

If above price fall between the slab rates mentioned in options inner text then it should enable and remaining disabled.

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

0

When you loop over to generate the dom, check if (price > min && price < max) to determine if to set a disabled on the option.

Or do after with jQuery, which question suggests

const minPrice = 1000
const maxPrice = 10000

$('.product-custom-option option').each(function() {
  const price = Number($(this).attr('price'))
  if (price >= minPrice && price <= maxPrice) {
    $(this).removeAttr('disabled')
  } else {
    $(this).attr('disabled', true)
  }
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<select class="product-custom-option">
  <option price="100">100</option>
  <option price="500">500</option>
  <option price="1000">1000</option>
  <option price="5000">5000</option>
  <option price="10000">10000</option>
  <option price="50000">50000</option>
</select>

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!