메

값 넘겨주기 input 이렇게 쓰는게 맞을까요?

· 2014-11-13 (목) 14:14:39 · 934 · 1

        <tr>
            <th scope="row"><label for="wr_5">정가/할인율<strong class="sound_only">필수</strong></label></th>
            <td><input type="text" name="wr_5" class="box" value="<?php echo $wr_5 ?>" id="wr_5" required class="frm_input required" size="20" maxlength="20"> x
   <input type="text" name="wr_6" class="box" value="<?php echo $wr_6 ?>" id="wr_6" required class="frm_input required" size="10" maxlength="20"> %</td>
        </tr>

<script>
$(".box").onkeypress(function(){
var result=$("input[name='wr_5']").val()+$("input[name='wr_6']").val();
 $("input[name='wr_7'].val(result);//
});
</script>


        <tr>
            <th scope="row"><label for="wr_7">할인가<strong class="sound_only">필수</strong></label></th>
            <td><input type="text" name="wr_7" value="<?php echo $wr_7 ?>" id="wr_7" class="box" required class="frm_input required" size="10" maxlength="20"></td>
        </tr>​

 

 

5 번 6 번 값을 더해서 7번에 바로 보여주기 하고 싶은데요. 저렇게 해봤는데 안되서요.

 

|

댓글 1개

괄호를 하나 안닫으셨네요.
댓글을 작성하시려면 로그인이 필요합니다.

개발자톡

1,532건
+
제목 글쓴이 날짜 조회
14-11-26 조회 1,098
14-11-25 조회 1,216
14-11-24 조회 2,939
14-11-24 조회 1,093
14-11-20 조회 2,027
14-11-18 조회 993
14-11-13 조회 703
14-11-13 조회 935
14-11-13 조회 867
14-11-12 조회 1,157
14-11-12 조회 1,520
14-11-11 조회 708
14-11-11 조회 1,370
14-11-09 조회 1,079
14-11-06 조회 1,056
14-11-03 조회 1,675
14-10-31 조회 1,120
14-10-30 조회 1,037
14-10-28 조회 1,680
14-10-27 조회 1,813
14-10-25 조회 982
14-10-25 조회 1,064
14-10-25 조회 1,226
14-10-22 조회 1,072
14-10-22 조회 1,753