Melody Scott
asked on
Use an oninput event to change states of another field
I have sort of a related question here: https://www.experts-exchange.com/questions/29151129/use-an-oninput-event-to-change-states-of-button.html
Please go to: https://dev.magickitchen.com/menu/main_courses.html and add something to the cart. If you need user/pw, please use mel/mel.
Then add a zip code and click on checkout. On the checkout page, you will see this:
What I would like to do is, if someone enters text into the field Company, I'd like the dropdown to automatically change from Residential to Commercial. Is that possible with jquery?
Please go to: https://dev.magickitchen.com/menu/main_courses.html and add something to the cart. If you need user/pw, please use mel/mel.
Then add a zip code and click on checkout. On the checkout page, you will see this:
What I would like to do is, if someone enters text into the field Company, I'd like the dropdown to automatically change from Residential to Commercial. Is that possible with jquery?
deleted, my bad!
$("#companyID").on("input", function() {
if( $.trim( $(this).val() ) != "" )
$("#addressType").val("Commercial");
});
replace companyID and addressType by, respectivly the ID of the company textbox and address type dropdown
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks! I will give this a try!
ASKER
Looks like I am out of hours for the week, so next Monday I'll get back to you.
Could you close the question please?
ASKER
Haven't made it work yet.
ASKER
Sorry that took so long! Works like a charm.
ASKER