diff --git a/2-ui/4-forms-controls/4-forms-submit/article.md b/2-ui/4-forms-controls/4-forms-submit/article.md index c00c559c0..ba76b9e91 100644 --- a/2-ui/4-forms-controls/4-forms-submit/article.md +++ b/2-ui/4-forms-controls/4-forms-submit/article.md @@ -1,25 +1,25 @@ -# Forms: event and method submit +# ফর্মস: ইভেন্ট এবং সাবমিট মেথড -The `submit` event triggers when the form is submitted, it is usually used to validate the form before sending it to the server or to abort the submission and process it in JavaScript. +যখন কোন ফর্ম সাবমিট করা হয় তখন `submit` ইভেন্ট সংগঠিত হয়, সাধারণত সার্ভারে রিকুয়েস্ট সেন্ডের পূর্বে ভ্যালিডেশনের জন্য এটি ব্যবহার করা হয়। -The method `form.submit()` allows to initiate form sending from JavaScript. We can use it to dynamically create and send our own forms to server. +`form.submit()` মেথড এর মাধ্যমে সার্ভারে রিকেয়েস্ট পাঠানো হয়। যখন ডায়নামিক্যালি আমরা ফর্ম তৈরি করি তখন এই মেথডটির সাহায্যে রিকেয়েস্ট পাঠানো হয়। -Let's see more details of them. +চলুন আরো বিস্তারিত জানা যাক। -## Event: submit +## ইভেন্ট: submit -There are two main ways to submit a form: +সাধারণত দুইভাবে আমরা ফর্ম সাবমিট করতে পারি: -1. The first -- to click `` or ``. -2. The second -- press `key:Enter` on an input field. +1. প্রথমটি ইনপুট এলিমেন্টের সাহায্যে `` বা ``। +2. দ্বিতীয়টি -- কোন ইনপুটে `key:Enter` প্রেসের মাধ্যমে। -Both actions lead to `submit` event on the form. The handler can check the data, and if there are errors, show them and call `event.preventDefault()`, then the form won't be sent to the server. +উভয়ইভাবেই ফর্মের `submit` সংগঠিত হয়। আমরা হ্যান্ডেলারে ডাটা ভ্যালিডেশন করে ডাটা সার্ভারে পাঠাতে পারি, আর যদি কোন এরর থাকে তাহলে তা দেখিয়ে `event.preventDefault()` এর মাধ্যমে সাবমিট থামাতে পারি, ফলে ডাটা ডাটা সার্ভারে যাবে না। -In the form below: -1. Go into the text field and press `key:Enter`. -2. Click ``. +নিচের ফর্মে: +1. টেক্সট ফিল্ডে ফোকাস করুন অতঃপর `key:Enter` বাটনে প্রেস করুন। +2. `` এ ক্লিক করুন। -Both actions show `alert` and the form is not sent anywhere due to `return false`: +উভয়ই ক্ষেত্রে আমরা `alert` দেখব এবং `return false` এর জন্য ডাটা সেন্ড হবে না: ```html autorun height=60 no-beautify
``` -````smart header="Relation between `submit` and `click`" -When a form is sent using `key:Enter` on an input field, a `click` event triggers on the ``. +````smart header="`submit` এবং `click` এর মাঝে সম্পর্ক" +যখন কোন ইনপুট ফিল্ডে `key:Enter` প্রেসের মাধ্যমে ফর্ম সাবমিট করা হয়, তখন `` এ একটি `click` ইভেন্ট সংগঠিত হয়। -That's rather funny, because there was no click at all. +ব্যাপারটা কেমন বিদঘুটে না? আমরা কোন ক্লিক করিনি তারপরও `click` ইভেন্ট সংগঠিত হয়। -Here's the demo: +এখানে দেখুন: ```html autorun height=60