lundi 2 janvier 2023

Setting a future day of repair depending on warranty selection

First of all I'm really new to Web Dev, just learnt basics of JS last week.

I have a project in which I have a VIP status, and 3 warranty types. If the client is VIP -> fixing the issue will take up to 7 days. Then I have 3 types of warranties - None, Regular, Extended. None - up to a month of repair. Regular - up to 3 weeks of repair. Extended - up to 2 weeks of repair.

The solution must include ONLY javascript (no jQuery yet). since the VIP checkbox isn't a part of the warranty selection, I'm having trouble connecting them.

In case my explanation confuses you - if the client is VIP - warranty options should be DISABLED. since it automatically gets a faster service. if VIP checkbox isn't checked - I need to show the time of repair as shown above.

Thanks in advance

 <input type="checkbox" id="isVIP" />VIP?
<select name="warranty" id="warranty">
          <option disabled selected>Select warranty</option>
          <option value="none">None</option>
          <option value="regular">Regular</option>
          <option value="Extended">Extended</option>



Aucun commentaire:

Enregistrer un commentaire