My goal is to hide a class (optional-field) when the page loads. But if the user selects a certain choice (total of two choices), then the hidden classes will show.
I was able to hide the classes (optional-field) when the page loads, but I can't for the life of me, get them to show when I select the right choice. (Below is the code) . NOTE: the this is dynamically created by PHP, so the [{VAL_OPTION_ID}] in productOptions[{VAL_OPTION_ID}] in the HTML is the PHP place holder. I did put up what it looks like after generated when the page loads as well below.
Besides not getting the class "optional-field" to show() when you select the option "Me" from the drop down, I had a couple other questions: 1) I found how to specify a ID or Class "." or "#" in your code, but not if the <select> uses "name" selector.
2) Also, I had to add a class to the <select> because I couldn't find how to identify it based on a "name" selector in the <select> tag.
3) Also, I tried putting an alert(send_type) to see what value send_type was after it was declared, but couldn't get any response back.
I was able to hide the classes (optional-field) when the page loads, but I can't for the life of me, get them to show when I select the right choice. (Below is the code) . NOTE: the this is dynamically created by PHP, so the [{VAL_OPTION_ID}] in productOptions[{VAL_OPTION_ID}] in the HTML is the PHP place holder. I did put up what it looks like after generated when the page loads as well below.
Besides not getting the class "optional-field" to show() when you select the option "Me" from the drop down, I had a couple other questions:
1) I found how to specify a ID or Class "." or "#" in your code, but not if the <select> uses "name" selector.
2) Also, I had to add a class to the <select> because I couldn't find how to identify it based on a "name" selector in the <select> tag.
3) Also, I tried putting an alert(send_type) to see what value send_type was after it was declared, but couldn't get any response back.
jQuery
This is the drop down before dynamically created:
This is the code after it is generated on the page:
Finally, Should you have all of it within the function?
I even tried to do it by the option values.
and I get nothing.