From 157ef5ae3d41b11808fa5564fa4d3b33165354ec Mon Sep 17 00:00:00 2001 From: Miguel Alejandro Bolivar Portilla Date: Fri, 15 Feb 2019 19:09:46 -0400 Subject: [PATCH] Translate: Basics > Forms (#132) --- content/docs/forms.md | 119 +++++++++++++++++++++--------------------- 1 file changed, 59 insertions(+), 60 deletions(-) diff --git a/content/docs/forms.md b/content/docs/forms.md index 1a8b599d5..190f93ff0 100644 --- a/content/docs/forms.md +++ b/content/docs/forms.md @@ -1,6 +1,6 @@ --- id: forms -title: Forms +title: Formularios permalink: docs/forms.html prev: lists-and-keys.html next: lifting-state-up.html @@ -9,27 +9,27 @@ redirect_from: - "docs/forms-zh-CN.html" --- -HTML form elements work a little bit differently from other DOM elements in React, because form elements naturally keep some internal state. For example, this form in plain HTML accepts a single name: +Los elementos de formularios en HTML funcionan un poco diferente a otros elementos del DOM en React, debido a que los elementos de formularios conservan naturalmente algún estado interno. Por ejemplo, este formulario solamente en HTML, acepta un solo nombre. ```html
- +
``` -This form has the default HTML form behavior of browsing to a new page when the user submits the form. If you want this behavior in React, it just works. But in most cases, it's convenient to have a JavaScript function that handles the submission of the form and has access to the data that the user entered into the form. The standard way to achieve this is with a technique called "controlled components". +Este formulario tiene el comportamiento predeterminado en HTML que consiste en navegar a una nueva página cuando el usuario envía el formulario. Si deseas este comportamiento en React, simplemente ya funciona así. Pero en la mayoría de casos, es conveniente tener una función en Javascript que se encargue del envío del formulario, y que tenga acceso a los datos que el usuario introdujo en el formulario. La forma predeterminada para conseguir esto es una técnica llamada "componentes controlados". -## Controlled Components {#controlled-components} +## Componentes Controlados {#controlled-components} -In HTML, form elements such as ``, ` ``` -In React, a `