Skip to content
Advertisement

How to enable/disable a certain field(s) base on input from drop-down menu?

Dropdown Menu id = payment_method

  • paid by reciever
  • charge through invoices

Dropdown Menu id = shipping_carrier

  • Fedex
  • DHL

Input Field id = shipping_number __________________

Goal:

if user select charge through invoices

  • disable shipping_carrier
  • set Fedex as default
  • hide() my shipping number input

Else,

  • enable the shipping_carrier
  • enable shipping number input (required)

Code

JavaScript

Advertisement

Answer

Here you go:

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement