[인터돌™] 공부 해보자!! 열심히~~~

반응형
jsp에서 라디오 버튼이 체크된 항목을 .js 에서 읽어들여야 하는데 이때 protype.js 를 쓴 경우 아래와 같이 값을 읽어올 수 있다.

AAAA.jsp

<form name="myform">
  <input type="radio" name="type" value="one"/>
  <input type="radio" name="type" value="two"/>
  <input type="radio" name="type" value="three"/>
</form>

#wrong
var typeValue = $F('type');

BBBB.js

var typeValue = Form.getInputs('myform','radio','type').find(function(radio) { return radio.checked; }).value;




그리고 확인해본건 아니지만 드롭다운의 경우
   $("orgName").value = $("selectComp").options[$("selectComp").selectedIndex].value;
요렇게 하면 되는거 같다.

이 글을 공유합시다

facebook twitter googleplus kakaoTalk kakaostory naver band