테스트 사이트 - 개발 중인 베타 버전입니다

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

        <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개

괄호를 하나 안닫으셨네요.

게시글 목록

번호 제목
27980
7164
31729
31726
31725
31720
31711
7159
27974
19734
19730
19729
27969
7142
19728
19725
7130
19722
19719
7124
19718
19717
19716
19715
7122
30959
19714
31710
31709
19713
7117
19712
7111
31708
31707
19710
31706
31705
31704
19709
19707
31703
19706
31702
19705
31701
19704
31700
31699
31698
7107
19703
31697
31696
19702
19701
31695
27965
31694
19700
31693
19699
31692
31691
19698
19697
19696
19694
19693
19692
19691
19690
19689
19688
19687
7105
30955
7100
19681
7097
19678
7089
7086
7084
7082
19677
30953
7080
7077
7071
7070
7066
19676
19674
27961
7063
7061
19669
7060
20842