목차
formaction 예제 - <button> 경우
formaction 정의
formaction 구문
formaction 예제 - <input type="submit"> 경우
formaction 예제 - <input type="image"> 경우
formaction 예제 - <button> 경우
<form action="/action_page .php" method="get">
<label for="name">이름:</label>
<input type="text" id="name" name="name"><br><br>
<label for="nick">별명:</label>
<input type="text" id="nick" name="nick"><br><br>
<button type="submit">확인</button>
<button type="submit" formaction="/action_page2 .php">확인2</button>
</form>
결과보기
formaction 정의
폼데이터 체줄될 시 처리할 파일 URL 주소를 별도 지정.
(즉, <form> 요소의 action 속성의 값을 덮어씀.)
1. formaction 속성 가능 태그 종류
<button type="submit">, <input type="submit">, <input type="image">
2.
모든 최신 브라우저 지원.
formaction 구문
<button type="submit" formaction="URL ">
<input type="submit" formaction="URL ">
[속성값]
URL
폼 데이터 제출될 시 처리할 파일의 URL 지정. (절대주소/상대주소 가능)
formaction 예제 - <input type="submit"> 경우
<form action="/action_page .php">
<label for="name">이름:</label>
<input type="text" id="name" name="name"><br><br>
<label for="nick">별명:</label>
<input type="text" id="nick" name="nick"><br><br>
<input type="submit" value="확인">
<input type="submit" formaction="/action_page2 .php" value="확인2">
</form>
결과보기
formaction 예제 - <input type="image"> 경우
<form action="/action_page .php">
<label for="name">이름:</label>
<input type="text" id="name" name="name"><br><br>
<label for="nick">별명:</label>
<input type="text" id="nick" name="nick"><br><br>
<input type="submit" value="확인">
<input type="image" src="submit.gif " alt="확인" formaction="/action_page2 .php" width="56" height="56">
</form>
결과보기
주소 복사
랜덤 이동