diff options
Diffstat (limited to 'files/pt-br/web/api/formdata/getall/index.html')
-rw-r--r-- | files/pt-br/web/api/formdata/getall/index.html | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/files/pt-br/web/api/formdata/getall/index.html b/files/pt-br/web/api/formdata/getall/index.html new file mode 100644 index 0000000000..5a9b51611c --- /dev/null +++ b/files/pt-br/web/api/formdata/getall/index.html @@ -0,0 +1,74 @@ +--- +title: FormData.getAll() +slug: Web/API/FormData/getAll +translation_of: Web/API/FormData/getAll +--- +<p>{{APIRef("XMLHttpRequest")}}</p> + +<p>O metodo <code><strong>getAll()</strong></code> do {{domxref("FormData")}} retorna todos os valores associados com a chave dentro <code>de um objeto FormData</code>.</p> + +<div class="note"> +<p><strong>Nota</strong>: Este metodo esta disponivel no <a href="/en-US/docs/Web/API/Web_Workers_API">Web Workers</a>.</p> +</div> + +<h2 id="Syntax">Syntax</h2> + +<pre class="brush: js">formData.getAll(name);</pre> + +<h3 id="append()_Parameters" name="append()_Parameters">Parametros</h3> + +<dl> + <dt><code>nome</code></dt> + <dd>O {{domxref("USVString")}} representa o mome da chave que você quer pegar.</dd> +</dl> + +<h3 id="Retorno">Retorno</h3> + +<p>Um array de {{domxref("FormDataEntryValue")}}s.</p> + +<h2 id="Examplo">Examplo</h2> + +<p>A seguinte linha cria um objeto <code>FormData</code> vazio:</p> + +<pre class="brush: js">var formData = new FormData();</pre> + +<p>Se nos adicionarmos dois valores oara <code>username</code> {{domxref("FormData.append")}}:</p> + +<pre class="brush: js">formData.append('username', 'Chris'); +formData.append('username', 'Bob');</pre> + +<p>A seguinte função <code>getAll()</code> retornara um arrat com os valore dentro de <code>username</code>:</p> + +<pre class="brush: js">formData.getAll('username'); // Returns ["Chris", "Bob"]</pre> + +<h2 id="Especificação">Especificação</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('XMLHttpRequest','#dom-formdata-getall','getAll()')}}</td> + <td>{{Spec2('XMLHttpRequest')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="Compatibilidade_de_Browsers">Compatibilidade de Browsers</h2> + + + +<p>{{Compat("api.FormData.getAll")}}</p> + +<h2 id="Veja_também">Veja também</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> |