HTML formaction 속성
정의 및 사용
속성 은 formaction
양식이 제출될 때 양식 데이터를 보낼 위치를 지정합니다. 이 속성은 양식의 속성을 재정의 action
합니다.
속성은 가 있는 formaction
입력/버튼에만 사용됩니다
type="submit"
.
에 적용
속성 은 formaction
다음 요소에 사용할 수 있습니다.
집단 | 기인하다 |
---|---|
<버튼> | 형성 |
<입력> | 형성 |
예
버튼 예
두 개의 제출 버튼이 있는 양식입니다. 첫 번째 제출 버튼은 "action_page.php"에 양식 데이터를 제출하고 두 번째 버튼은 "action_page2.php"에 제출합니다.
<form action="/action_page.php" method="get">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<button type="submit">Submit</button><br>
<button type="submit" formaction="/action_page2.php">Submit to another page</button>
</form>
입력 예
다른 작업과 함께 두 개의 제출 버튼이 있는 HTML 양식:
<form action="/action_page.php">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="Submit"><br>
<input type="submit" formaction="/action_page2.php" value="Submit to another page">
</form>
브라우저 지원
특성 은 formaction
각 요소에 대해 다음 브라우저 지원을 가집니다.
Element | |||||
---|---|---|---|---|---|
button | 9.0 | 10.0 | 4.0 | 5.1 | 10.6 |
input | 9.0 | 10.0 | 4.0 | 5.1 | 10.6 |