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

회원가입 경로를 선택하고 싶습니다. 채택완료

모래위 9년 전 조회 5,796

안녕하세요.

회원가입 시 약관 register.php 에서 

 

동의 체크 후 

 

하단에 일반회원과 업체회원 가입버튼을 넣었습니다.

 

일반회원가입 -> register_form.php

업체회원가입 -> register_company_form.php

 

동의 후 각 URL 로 이동하고 싶은데요.

a href 로 하니 form 전송이 안되어 안되네요ㅠㅠ

 

어떻게 해야하나요? ㅜ..ㅜ

도움주시면 정말 감사하겠습니다. 

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

답변 1개

채택된 답변
+20 포인트
p
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';" 로 해결했네요.

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

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

로그인