0
두 개의 테이블을 만들었습니다. 첫번째는 우편물 주소 (우편물 거리, 도시 등)입니다. 두 번째 표는 배송 주소입니다. 필드는 우편 주소와 거의 같습니다. 배송 주소가 우편 주소와 같다고 가정합니다. 어떻게 첫 번째 테이블의 데이터를 두 번째 테이블로 복사 할 라디오 버튼을 만들 수 있습니까?사용자 입력 데이터 세트를 양식의 다른 영역으로 전달
사용자가 입력 한 데이터는 MySQL 데이터베이스에 저장됩니다.
어떻게 이런 일을 할 수 있습니까?
<script type="text/javascript">
function data_copy(){
if(document.form1.copy[0].checked){
document.form1.txtmailing_add2.value=document.form1.txtmailing_add1.value; document.form1.Address.txtother_street.value=document.form1.Address.txtmailing_street.value;
document.form1.Address.txtother_city.value=document.form1.Address.txtmailing_city.value; document.form1.Address.txtother_state.value=document.form1.Address.txtmailing_state.value;
document.form1.Address.txtother_postcode.value=document.form1.Address.txtmailing_postcode.value; document.form1.Address.txtother_country.value=document.form1.Address.txtmailing_country.value;
}
else{
document.form1.Address.txtmailing_add2.value="";
document.form1.Address.txtother_street.value="";
document.form1.Address.txtother_city.value="";
document.form1.Address.txtother_state.value="";
document.form1.Address.txtother_postcode.value="";
document.form1.Address.txtother_country.value="";
}
}
</script>
<form name=form1 method=post action="">
</form>
내가 생각
, 당신이 내가 시도 – sathish
표에 값을 라디오 버튼을 클릭하면, 자바 스크립트를 사용하여 배송 주소로 우편 주소의 값을 전달하고 저장할 수 있습니다 : 여기에 지금까지 시도 무엇 그것을 해결하기 위해 자바 스크립트를 사용하십시오. 그러나 일은 없다. –
그런 다음 onSubmit에서 조건을 확인하십시오. 확인란 또는 옵션 상자가 선택된 경우 우편 주소의 값을 두 테이블에 모두 추가하십시오. – sathish