Skip to content

Conversation

@aladin002dz
Copy link
Member

No description provided.

@netlify
Copy link

netlify bot commented Feb 21, 2019

Deploy preview for ar-reactjs ready!

Built with commit 31f6968

https://deploy-preview-17--ar-reactjs.netlify.com

@aladin002dz
Copy link
Member Author

I used hsoub translation with "forms.md", I made the markdown arrangements.

Copy link
Member

@asantarissy asantarissy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @aladin002dz, great job.

I left you couple of comments please check them out, also make sure you pull this repo master branch to make sure your branch is up-to-date.

Cheers!

<input type="text" name="name" />
</label>
<input type="submit" value="Submit" />
<input type="submit" value="تقديم البيانات" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that we're going to translate code snippets. if you can keep it in English please.

@iRayan7 what do you think?

}
```

Notice that `this.state.value` is initialized in the constructor, so that the text area starts off with some text in it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this.

## Handling Multiple Inputs {#handling-multiple-inputs}
## التعامل مع إدخالات متعددة {#handling-multiple-inputs}

When you need to handle multiple controlled `input` elements, you can add a `name` attribute to each element and let the handler function choose what to do based on the value of `event.target.name`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review and fix this.

، وهي تقنيّة بديلة للتعامل مع حقول الإدخال.

## Fully-Fledged Solutions {#fully-fledged-solutions}
## حلول متناهية-الصغر {#fully-fledged-solutions}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be: حلول أخرى متكاملة

## حلول متناهية-الصغر {#fully-fledged-solutions}

If you're looking for a complete solution including validation, keeping track of the visited fields, and handling form submission, [Formik](https://jaredpalmer.com/formik) is one of the popular choices. However, it is built on the same principles of controlled components and managing state — so don't neglect to learn them.
إذا كنت تبحث عن حل كامل بما في ذلك التحقق من الصحة ، وتتبع الحقول التي قمت بزيارتها ، والتعامل مع إرسال النموذج ، فإن
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Please remove spaces before commas
  • Change "للمكونات الخاضعة للرقابة" to "للمكونات المضبوطة"
  • Change "التحقق من الصحة" to "التحقق من صحة الحقول"

@aladin002dz
Copy link
Member Author

all the notes handled, please check now @asantarissy

---
id: forms
title: Forms
title: الحقول
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change الحقول or حقل to نماذج or نموذج in this file.

When you need to handle multiple controlled `input` elements, you can add a `name` attribute to each element and let the handler function choose what to do based on the value of `event.target.name`.
عندما تحتاج إلى التعامل مع عناصر `input` مُتعدِّدة مضبوطة فبإمكانك إضافة الخاصيّة `name` إلى كل عنصر وتترك لدالة معالجة الأحداث أن تختار ما ستفعله بناءً على قيمة `event.target.name`، فلنأخذ هذا المثال:

For example:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this.

يمتلك هذا الحقل نفس السّلوك الافتراضي لحقول HTML من حيث الانتقال إلى صفحة جديدة عندما يضغط المستخدم على زر تقديم البيانات (Submit)، وإن أردت فقط هذا السّلوك في React فسيعمل بشكل جيّد معك، ولكن في معظم الأحيان من الملائم أكثر أن نمتلك دالة في JavaScript تتعامل مع تقديم البيانات ولديها الوصول إلى البيانات التي أدخلها المستخدم في الحقل. الطريقة القياسيّة لتحقيق هذا الأمر هي باستخدام تقنيّة تدعى المُكوِّنات المضبوطة (controlled components).

In HTML, form elements such as `<input>`, `<textarea>`, and `<select>` typically maintain their own state and update it based on user input. In React, mutable state is typically kept in the state property of components, and only updated with [`setState()`](/docs/react-component.html#setstate).
## المكونات الخاضعة للرقابة {#controlled-components}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change المكونات الخاضعة للرقابة to المكونات المضبوطة in this file

Copy link
Member

@asantarissy asantarissy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @aladin002dz so much for your first contribution! we couldn't run this project without people like you. 🎉

@asantarissy asantarissy merged commit c2a69e7 into reactjs:master Feb 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants