aboutsummaryrefslogtreecommitdiff
path: root/files/ru/web/html/element/input/image/index.html
blob: a62b94690676eec48787f30a1502991fa0648c99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
---
title: <input type="image">
slug: Web/HTML/Element/Input/image
translation_of: Web/HTML/Element/input/image
---
<p><code>&lt;input type="image"&gt; - это кнопка отправки в виде изображения. Вы можете использовать атрибут src, чтобы выбрать источник изображения и атрибут alt, чтобы добавить альтернативный текст. Атрибутами width и height можно указать размер изображения в пикселях.</code></p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">Разрешённое содержимое</th>
   <td>Нету, это пустой элемент.</td>
  </tr>
  <tr>
   <th scope="row">Необязательный закрывающийся тег</th>
   <td>Обязательно должен быть открывающийся тег, и обязательно отсутствует закрывающий.</td>
  </tr>
  <tr>
   <th scope="row">Разрешённые родительские элементы</th>
   <td>Любой элемент, которому доступен фразообразующий контент (<a href="/en-US/docs/HTML/Content_categories#Phrasing_content">phrasing content</a>).</td>
  </tr>
  <tr>
   <th scope="row">DOM-интерфейс </th>
   <td>{{domxref("HTMLInputElement")}}</td>
  </tr>
 </tbody>
</table>

<h2 id="Атрибуты">Атрибуты</h2>

<p>Этому элементу доступны глобальные атрибуты (<a href="/en-US/docs/HTML/Global_attributes">global attributes</a>).</p>

<p>{{htmlattrdef("type")}}</p>

<dl>
 <dt>{{htmlattrdef("formaction")}} {{HTMLVersionInline("5")}}</dt>
 <dd>The URI of a program that processes the information submitted by the input element, here image if specified, it overrides the {{htmlattrxref("action","form")}} attribute of the element's form owner.</dd>
</dl>

<dl>
 <dt>{{htmlattrdef("formenctype")}} {{HTMLVersionInline("5")}}</dt>
 <dd>If the input element is an image, this attribute specifies the type of content that is used to submit the form to the server. Possible values are:
 <ul>
  <li><code>application/x-www-form-urlencoded</code>: The default value if the attribute is not specified.</li>
  <li><code>multipart/form-data</code>: Use this value if you are using an {{HTMLElement("input")}} element with the {{htmlattrxref("type","input")}} attribute set to <code>file</code>.</li>
  <li><code>text/plain</code></li>
 </ul>

 <p>If this attribute is specified, it overrides the {{htmlattrxref("enctype","form")}} attribute of the element's form owner.</p>
 </dd>
 <dt>{{htmlattrdef("formmethod")}} {{HTMLVersionInline("5")}}</dt>
 <dd>In image input element, this attribute specifies the HTTP method that the browser uses to submit the form. Possible values are:
 <ul>
  <li><code>post</code>: The data from the form is included in the body of the form and is sent to the server.</li>
  <li><code>get</code>: The data from the form is appended to the <strong>form</strong> attribute URI, with a '?' as a separator, and the resulting URI is sent to the server. Use this method when the form has no side-effects and contains only ASCII characters.</li>
 </ul>

 <p>If specified, this attribute overrides the {{htmlattrxref("method","form")}} attribute of the element's form owner.</p>
 </dd>
 <dt>{{htmlattrdef("formnovalidate")}} {{HTMLVersionInline("5")}}</dt>
 <dd>This Boolean attribute specifies that the form is not to be validated when it is submitted. If this attribute is specified, it overrides the {{htmlattrxref("novalidate","form")}} attribute of the element's form owner.</dd>
 <dt>{{htmlattrdef("formtarget")}} {{HTMLVersionInline("5")}}</dt>
 <dd>This attribute is a name or keyword indicating where to display the response that is received after submitting the form. This is a name of, or keyword for, a <em>browsing context</em> (for example, tab, window, or inline frame). If this attribute is specified, it overrides the {{htmlattrxref("target", "form")}} attribute of the element's form owner. The following keywords have special meanings:
 <ul>
  <li>_<code>self</code>: Load the response into the same browsing context as the current one. This value is the default if the attribute is not specified.</li>
  <li><code>_blank</code>: Load the response into a new unnamed browsing context.</li>
  <li><code>_parent</code>: Load the response into the parent browsing context of the current one. If there is no parent, this option behaves the same way as <code>_self</code>.</li>
  <li><code>_top</code>: Load the response into the top-level browsing context (that is, the browsing context that is an ancestor of the current one, and has no parent). If there is no parent, this option behaves the same way as <code>_self</code>.</li>
 </ul>
 </dd>
 <dt>{{htmlattrdef("height")}} {{HTMLVersionInline("5")}}</dt>
 <dd>This attribute defines the height of the image displayed for the button.</dd>
 <dt>{{htmlattrdef("required")}} {{HTMLVersionInline("5")}}</dt>
 <dd>This attribute specifies that the user must fill in a value before submitting a form but it cannot be used when the <strong>type</strong> attribute is <code>image</code> type (<code>submit</code>, <code>reset</code>, or <code>button</code>). The {{cssxref(":optional")}} and {{cssxref(":required")}} CSS pseudo-classes will be applied to the field as appropriate.</dd>
 <dt>{{htmlattrdef("src")}}</dt>
 <dd>This attribute specifies a URI for the location of an image to display on the graphical submit button; otherwise it is ignored.</dd>
 <dt>{{htmlattrdef("usemap")}} {{HTMLVersionInline(4)}} only, {{obsoleteGeneric("inline", "HTML5")}}</dt>
 <dd>The name of a {{HTMLElement("map")}} element as an image map.</dd>
 <dt>{{htmlattrdef("width")}} {{HTMLVersionInline("5")}}</dt>
 <dd>This attribute defines the width of the image displayed for the button.</dd>
 <dt>
 <h2 id="Примеры">Примеры</h2>
 </dt>
</dl>

<h3 id="simple_input_image_example" name="simple_input_image_example">Поле в виде логотипа Firefox </h3>

<pre class="brush: html">&lt;input type="image" name="image" src="https://mdn.mozillademos.org/files/2917/fxlogo.png" width="50"&gt;</pre>

<h4 id="Результат">Результат</h4>

<p>{{ EmbedLiveSample('simple_input_image_example') }}</p>

<h2 id="Спецификации">Спецификации</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Спецификация</th>
   <th scope="col">Статус</th>
  </tr>
  <tr>
   <td>{{SpecName('HTML WHATWG', 'forms.html#image-button-state-(type=image)', '&lt;input type="image"&gt;')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', 'forms.html#image-button-state-%28type=image%29', '&lt;input type="image"&gt;')}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML4.01', 'interact/forms.html#h-17.4', '&lt;form&gt;')}}</td>
   <td>{{Spec2('HTML4.01')}}</td>
  </tr>
 </tbody>
</table>

<h2 id="Браузерная_совместимость">Браузерная совместимость</h2>

<p>{{Compat("html.elements.input.input-image")}}</p>

 <h2 id="Смотрите_также">Смотрите также</h2>
 </dt>
</dl>