on 2019 Nov 27 6:45 AM
<c:set var="cmsPages" value="${cmsPage.uid eq 'B2COrderHistory' or cmsPage.uid eq'B2CSavedCart'}" />
<c:if test="${cmsPages eq 'TRUE'}">
<ycommerce:testId code="header_currency_select"> <select name="code" id="currency-selector" disabled >
<c:forEach items="${currencies}" var="curr" > <option value="${fn:escapeXml(curr.isocode)}" ${curr.isocode == currentCurrency.isocode ? 'selected="selected"' : ''}>
<c:out value="${curr.symbol} ${curr.isocode}" /> </option> </c:forEach> </select> </ycommerce:testId>
</c:if>
<c:if test="${cmsPages eq 'FALSE'}">
<ycommerce:testId code="header_currency_select">
<select name="code" id="currency-selector" > <c:forEach items="${currencies}" var="curr"> <option value="${fn:escapeXml(curr.isocode)}" ${curr.isocode == currentCurrency.isocode ? 'selected="selected"' : ''}>
<c:out value="${curr.symbol} ${curr.isocode}" />
</option>
</c:forEach>
</select>
</ycommerce:testId>
</c:if>
How can i write condition in disabled so no need to use two <c:if> so if I am on orderhistory page my dropdown should be disable otherwise on other cms page should be enable.
Request clarification before answering.
working with this ternary operator
<select name="code" id="currency-selector" ${cmsPages?'disabled':"" } >
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.