aboutsummaryrefslogtreecommitdiff
path: root/files/de/web/api/formdata/getall/index.html
blob: 09cdc69036e4352cf4e09bfeced620f6e95a8dec (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
---
title: FormData.getAll()
slug: Web/API/FormData/getAll
translation_of: Web/API/FormData/getAll
---
<p>{{APIRef("XMLHttpRequest")}}</p>

<p>Die <code><strong>getAll()</strong></code> Methode der  {{domxref("FormData")}} Schnittstelle gibt alle Werte zurück, die innerhalb eines <code>FormData</code> Objekts mit einem gegebenen Schlüssel assoziiert sind.</p>

<div class="note">
<p><strong>Hinweis</strong>: Diese Methode ist in <a href="/en-US/docs/Web/API/Web_Workers_API">Web Workers</a> verfügbar.</p>
</div>

<h2 id="Syntax">Syntax</h2>

<pre class="brush: js">formData.getAll(name);</pre>

<h3 id="append()_Parameters" name="append()_Parameters">Parameter</h3>

<dl>
 <dt><code>name</code></dt>
 <dd>Ein {{domxref("USVString")}}, der den Namen des Schlüssels darstellt, der abgerufen werden soll.</dd>
</dl>

<h3 id="Rückgabewerte">Rückgabewerte</h3>

<p>Ein Array von {{domxref("FormDataEntryValue")}}s.</p>

<h2 id="Beispiel">Beispiel</h2>

<p>Die folgende Zeile erstellt ein leeres <code>FormData</code> Objekt:</p>

<pre class="brush: js">var formData = new FormData();</pre>

<p>Hinzufügen von zwei <code>username</code> Werten mit Hilfe von {{domxref("FormData.append")}}:</p>

<pre class="brush: js">formData.append('username', 'Chris');
formData.append('username', 'Bob');</pre>

<p>Der darauffolgende Aufruf der <code>getAll()</code> Funktion gibt beide <code>username</code> Werte in einem Array zurück.:</p>

<pre class="brush: js">formData.getAll('username'); // gibt ["Chris", "Bob"] zurück</pre>

<h2 id="Spezifikation">Spezifikation</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Spezifikation</th>
   <th scope="col">Status</th>
   <th scope="col">Kommentar</th>
  </tr>
  <tr>
   <td>{{SpecName('XMLHttpRequest','#dom-formdata-getall','getAll()')}}</td>
   <td>{{Spec2('XMLHttpRequest')}}</td>
   <td> </td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_Kompatibilität">Browser Kompatibilität</h2>



<p>{{Compat("api.FormData.getAll")}}</p>

<h2 id="Siehe_auch">Siehe auch</h2>

<ul>
 <li>{{domxref("XMLHTTPRequest")}}</li>
 <li><a href="/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest" title="Using XMLHttpRequest">Using XMLHttpRequest</a></li>
 <li><a href="/en-US/docs/DOM/XMLHttpRequest/FormData/Using_FormData_Objects" title="DOM/XMLHttpRequest/FormData/Using_FormData_objects">Using FormData objects</a></li>
 <li>{{HTMLElement("Form")}}</li>
</ul>