How to implementing Dynamic option value Hiding and Showing for ios devices.

To implement dynamic option value hiding and showing for iOS devices, Given a example, we can follow these steps

  1. Give each section and option value a unique class or ID for easy identification.
var selectElement = document.getElementById("custcol_ag_logooptionselectbox-inputid");
					var selectElementSecond = document.getElementById("custcol_ag_logooptionselectbox-dataid");

2. one where we removed the $0 color logo and another where we removed the $90 color logo.

var optionIndexToRemove = -1;
					for (var i = 0; i < selectElement.options.length; i++) {
						if (selectElement.options[i].value === "3") {
							optionIndexToRemove = i;
							break;
						}

					}
					if (optionIndexToRemove !== -1) {
						selectElement.remove(optionIndexToRemove);
					}

					for (var i = 0; i < selectElementSecond.options.length; i++) {
						if (selectElementSecond.options[i].value === "6") {
							optionIndexToRemove = i;
							break;
						}

					}
					if (optionIndexToRemove !== -1) {
						selectElementSecond.remove(optionIndexToRemove);
					}
					

 3. Based on the class name, we implemented a function to hide and show elements by selecting the company color.

if (companyColor == 1) {
						document.getElementById("personalized-logo-checkbox").checked = false;
						$('.pdp-first-logo').hide();
						$('.pdp-configurator-logo-text-block').hide();
					}
					else {
						document.getElementById("personalized-logo-checkbox").checked = true;
						$('.pdp-first-logo').show();
						$('.pdp-configurator-logo-text-block').show();
					}

Leave a comment

Your email address will not be published. Required fields are marked *