Change function dynamically
Hi there,
I'm using a function that hides and shows content.
- $('.new-customer-details').enableValidators(false);
-
- $('.quote-customer-select select').change(function () {
- var selected = $(this).find(':selected').val()
- if (selected == '-1') {
- $('.new-customer-details').slideDown();
- $('.new-customer-details').enableValidators(true);
- }
- else {
- $('.new-customer-details').slideUp();
- $('.new-customer-details').enableValidators(false);
- }
- })
In my example where the value="-1" is selected from the drop down list the content is show. All good.
My question is how can I change and bind the above dynamically?
My drop down list has a list of names from a table called User. Each name has a value "ExternalUser" true or false. If an external user is selected from the drop down list I want my Jquery function to fire and show the content.
Hope that makes some kind of sense.
Many thanks