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

자바스크립트관련 자동계산 채택완료

천사들의아빠 11년 전 조회 4,895
부족하게 나마 자동계산이 되게 만들어 보려고 합니다.
여분필드에 explode를 사용하여 아래와 같이 여러필드로 나누어서 사용했습니다.
아래와 같이 자바스크립트를 짠후에 제품 개수를 적으면 각 제품의 무게가 자동으로 계산되게 하고 싶어서 아래와 같이 스크립트를 구성했습니다.
화면상에는 자동계산되어 진것이 보여지는데 그 상태로 올리면 각 제품의 개수는 나눈 필드에 저장이 되는데 계산된 결과는 저장이 되질 않습니다.
///////////////////////필드 나눈부분///////////////////////////
$ex11_filed = explode("|",$write[wr_11]);
$ext11_00  = $ex11_filed[0];
$ext11_01  = $ex11_filed[1];
$ext11_02  = $ex11_filed[2];
$ext11_03  = $ex11_filed[3];
$ext11_04  = $ex11_filed[4];
$ext11_05  = $ex11_filed[5];
$ext11_06  = $ex11_filed[6];
$ext11_07  = $ex11_filed[7];
$ext11_08  = $ex11_filed[8];
$ext11_09  = $ex11_filed[9];
$ext11_10  = $ex11_filed[10];
$ext11_11  = $ex11_filed[11];
$ext11_12  = $ex11_filed[12];
$ext11_13  = $ex11_filed[13];
$ext11_14  = $ex11_filed[14];
$ext11_15  = $ex11_filed[15];
$ext11_16  = $ex11_filed[16];
$ext11_17  = $ex11_filed[17];
$ext11_18  = $ex11_filed[18];
$ext11_19  = $ex11_filed[19];
$ext11_20  = $ex11_filed[20];
$ext11_21  = $ex11_filed[21];
$ext11_22  = $ex11_filed[22];
$ex12_filed = explode("|",$write[wr_12]);
$ext12_00  = $ex12_filed[00];
$ext12_01  = $ex12_filed[01];
$ext12_02  = $ex12_filed[02];
$ext12_03  = $ex12_filed[03];
/////////////스크립트 부분///////////// 
function calculate()
{
  ext11_01 = document.getElementById('ext11_01'); 
  ext11_03 = document.getElementById('ext11_03'); 
  ext11_05 = document.getElementById('ext11_05'); 
  ext11_07 = document.getElementById('ext11_07'); 
  ext12_00 = document.getElementById('ext12_00');
  ext12_00.value = eval(ext11_01.value*3.50) + eval(ext11_03.value*4.00) + eval(ext11_05.value*5.00) + eval(ext11_07.value*6.00); 
}
///////////////////php 부분/////////////////////////
총무게 :  
                                   KG 
-------------------------------------------------------------------------------------------------------
댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트
11년 전
name="ex12_00"
=> name="ext12_00"
로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

천사들의아빠
11년 전
감사합니다...ㅎㅎ 눈이 삐꾸였나봐요 ㅎㅎ

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인