답변 1개
채택된 답변
+20 포인트
9년 전
각각 버튼에 id 를 잡아주시고
id 값으로 분기 하셔서 form 을 전달 하는것로 처리 하는 방법이 있습니다.
form 의 action 을 하나로 fix 하면 당연히 안되겠지요
</p><p><span style="color: rgb(0, 0, 0);">function reg(id) {</span></p><p style="margin-left: 40px;"><span style="color: rgb(0, 0, 0);">if (id === 'com') {</span></p><p style="margin-left: 80px;"><span style="color: rgb(0, 0, 0);">form.action = "</span><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;">register_company_form.php</span><span style="color: rgb(0, 0, 0); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;">";</span></p><p style="margin-left: 40px;"><span style="color: rgb(0, 0, 0);">} else {</span></p><p style="margin-left: 80px;"><span style="font-size: 14.6667px;">form.action = "</span><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;">register_form.php</span><span style="font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;">";</span><span style="color: rgb(0, 0, 0);"> </span></p><p style="margin-left: 40px;"><span style="color: rgb(0, 0, 0);">}</span></p><p><span style="color: rgb(0, 0, 0);">} </span></p><p><span style="font-size: 14.6667px;">
뭐 이런식으로..
코드는 정상적인 코드가 아니라 말로 풀어쓰기 위한 예시 코드이므로 코드는 직업 구성하셔야 합니다.
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
�
모래위
9년 전
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
간단하게 onClick="this.form.action='URL';" 로 해결했네요.