diff --git a/content/docs/forms.md b/content/docs/forms.md index 1a8b599d5..8edb3c898 100644 --- a/content/docs/forms.md +++ b/content/docs/forms.md @@ -1,6 +1,6 @@ --- id: forms -title: Forms +title: فرمها permalink: docs/forms.html prev: lists-and-keys.html next: lifting-state-up.html @@ -9,7 +9,7 @@ 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: +المنتهای فرم HTML در نحوهی کارکرد با المنتهای دیگر DOM در ریاکت تفاوت جزیی دارند، به این دلیل که المنتهای فرم به صورت طبیعی مقداری state درونی نگهداری میکنند. برای مثال، این فرم که بهصورت HTML ساده نوشته شده است تنها یک نام دریافت میکند: ```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". +این فرم رفتار پیش فرض فرم HTML که کاربر پس از ثبت فرم به صفحهی جدید انتقال پیدا میکند را داراست . اگر این رفتار را در ریاکت میخواهید نیاز به انجام هیچ تغییری ندارید. اما در بیشتر موارد، مناسب است که یک تابع جاوااسکریپت داشتهباشیم که ثبت فرم را انجام میدهد و به دادههایی که کاربر در فرم وارد کرده است دسترسی دارد. روش استاندارد پیاده سازی این رفتار تکنیکی به نام "کامپوننتهای کنترلشده" میباشد. -## Controlled Components {#controlled-components} +## کامپوننتهای کنترلشده {#controlled-components} -In HTML, form elements such as ``, `