HTML <input> formtarget attribute

Definition and Usage

formtarget attribute can be set to a name or keyword, specifying where the response is displayed after the form is submitted.

formtarget attribute overrides the target attribute

Note:formtarget The attribute can be combined with type="submit" and type="image" Used together.

Example

Form with two submit buttons. The first submit button uses the default target to submit form data, and the second submit button submits the form data to a new window:

<form action="/action_page.php">
  <input type="text" id="fname" name="fname"><br><br>
  <label for="lname">surname:</label>
  <input type="text" id="lname" name="lname"><br><br>
  <input type="submit" value="normal submit">
  <input نوع="submit" formtarget="_blank" قيمة="إرسال إلى نافذة جديدة">
</form>

جرب بنفسك

القواعد

<input formtarget="_blank|_self|_parent|_top|اسم_الإطار">

قيمة الخاصية

القيمة الوصف
_blank عرض الاستجابة في نافذة جديدة/علامة تبويب جديدة.
_self عرض الاستجابة في الإطار نفسه (الافتراضي).
_parent عرض الاستجابة في الإطار الأم.
_top عرض الاستجابة في النافذة الكاملة.
اسم_الإطار عرض الاستجابة في iframe المسمى.

دعم المتصفح

الرقم في الجدول يشير إلى إصدار المتصفح الذي يدعم هذا الخصائص لأول مرة.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
الدعم 10.0 الدعم 5.1 10.6