Browse Source

브랜드선택시 브랜드명 자동 노출

eskim 4 years ago
parent
commit
8618741654
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/main/webapp/WEB-INF/views/goods/GoodsSizeInfoForm.html

+ 6 - 1
src/main/webapp/WEB-INF/views/goods/GoodsSizeInfoForm.html

@@ -88,7 +88,7 @@
 											<label class="rdoBtn"><input type="radio" name="selfYn"  value="Y"/>자사브랜드</label>
 											<select name="brandCd" id="brandCd">
 												<option value="" >[선택]</option>
-												<option th:if="${selfBrandList}" th:each="oneData, status : ${selfBrandList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+												<option th:if="${selfBrandList}" th:each="oneData, status : ${selfBrandList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}" th:attr="brandNm=${oneData.cdNm}"></option>
 											</select>
 										</td>
 									</tr>
@@ -243,6 +243,11 @@
 		
 	});
 	
+	// 브랜드 변경
+	$("#sizeInfoForm select[name=brandCd]").bind('change', function () {
+		$("#sizeInfoForm input[name=sizeCate2Nm]").val($("#sizeInfoForm select[name=brandCd] option:selected").attr("brandNm"));
+	});
+	
 	// 사이즈정보 저장
 	$("#btnSave").on('click', function() {