Skip to content

Commit 061c8c6

Browse files
committed
form-submit
1 parent 884ddd1 commit 061c8c6

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

2-ui/4-forms-controls/4-forms-submit/article.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# Forms: event and method submit
1+
# ফর্মস: ইভেন্ট এবং সাবমিট মেথড
22

3-
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.
3+
যখন কোন ফর্ম সাবমিট করা হয় তখন `submit` ইভেন্ট সংগঠিত হয়, সাধারণত সার্ভারে রিকুয়েস্ট সেন্ডের পূর্বে ভ্যালিডেশনের জন্য এটি ব্যবহার করা হয়।
44

5-
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.
5+
`form.submit()` মেথড এর মাধ্যমে সার্ভারে রিকেয়েস্ট পাঠানো হয়। যখন ডায়নামিক্যালি আমরা ফর্ম তৈরি করি তখন এই মেথডটির সাহায্যে রিকেয়েস্ট পাঠানো হয়।
66

7-
Let's see more details of them.
7+
চলুন আরো বিস্তারিত জানা যাক।
88

9-
## Event: submit
9+
## ইভেন্ট: submit
1010

11-
There are two main ways to submit a form:
11+
সাধারণত দুইভাবে আমরা ফর্ম সাবমিট করতে পারি:
1212

13-
1. The first -- to click `<input type="submit">` or `<input type="image">`.
14-
2. The second -- press `key:Enter` on an input field.
13+
1. প্রথমটি ইনপুট এলিমেন্টের সাহায্যে `<input type="submit">` বা `<input type="image">`
14+
2. দ্বিতীয়টি -- কোন ইনপুটে `key:Enter` প্রেসের মাধ্যমে।
1515

16-
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.
16+
উভয়ইভাবেই ফর্মের `submit` সংগঠিত হয়। আমরা হ্যান্ডেলারে ডাটা ভ্যালিডেশন করে ডাটা সার্ভারে পাঠাতে পারি, আর যদি কোন এরর থাকে তাহলে তা দেখিয়ে `event.preventDefault()` এর মাধ্যমে সাবমিট থামাতে পারি, ফলে ডাটা ডাটা সার্ভারে যাবে না।
1717

18-
In the form below:
19-
1. Go into the text field and press `key:Enter`.
20-
2. Click `<input type="submit">`.
18+
নিচের ফর্মে:
19+
1. টেক্সট ফিল্ডে ফোকাস করুন অতঃপর `key:Enter` বাটনে প্রেস করুন।
20+
2. `<input type="submit">` এ ক্লিক করুন।
2121

22-
Both actions show `alert` and the form is not sent anywhere due to `return false`:
22+
উভয়ই ক্ষেত্রে আমরা `alert` দেখব এবং `return false` এর জন্য ডাটা সেন্ড হবে না:
2323

2424
```html autorun height=60 no-beautify
2525
<form onsubmit="alert('submit!');return false">
@@ -28,12 +28,12 @@ Both actions show `alert` and the form is not sent anywhere due to `return false
2828
</form>
2929
```
3030

31-
````smart header="Relation between `submit` and `click`"
32-
When a form is sent using `key:Enter` on an input field, a `click` event triggers on the `<input type="submit">`.
31+
````smart header="`submit` এবং `click` এর মাঝে সম্পর্ক"
32+
যখন কোন ইনপুট ফিল্ডে `key:Enter` প্রেসের মাধ্যমে ফর্ম সাবমিট করা হয়, তখন `<input type="submit">` এ একটি `click` ইভেন্ট সংগঠিত হয়।
3333

34-
That's rather funny, because there was no click at all.
34+
ব্যাপারটা কেমন বিদঘুটে না? আমরা কোন ক্লিক করিনি তারপরও `click` ইভেন্ট সংগঠিত হয়।
3535

36-
Here's the demo:
36+
এখানে দেখুন:
3737
```html autorun height=60
3838
<form onsubmit="return false">
3939
<input type="text" size="30" value="Focus here and press enter">
@@ -43,13 +43,13 @@ Here's the demo:
4343

4444
````
4545
46-
## Method: submit
46+
## মেথড: submit
4747
48-
To submit a form to the server manually, we can call `form.submit()`.
48+
ম্যানুয়ালি একটি ফর্ম সাবমিটের জন্য আমরা `form.submit()` ব্যবহার করি।
4949
50-
Then the `submit` event is not generated. It is assumed that if the programmer calls `form.submit()`, then the script already did all related processing.
50+
তখন `submit` ইভেন্টটি সংগঠিত হয় না। কেননা `form.submit()` কল করা প্রোগ্রামের মাধ্যমে, সুতরাং আমরা ধরে নিতে পারি ডেভলাপার সকল ভ্যালিডেশন করার পর এই মেথডটি কল করছে।
5151
52-
Sometimes that's used to manually create and send a form, like this:
52+
অনেক সময় স্ক্রিপ্টের মাধ্যমে ফর্ম তৈরি করে তা সাবমিটের জন্য আমরা এটি ব্যবহার করি, নিচে একটি উদাহরণ দেয়া হল:
5353
5454
```js run
5555
let form = document.createElement('form');
@@ -58,7 +58,7 @@ form.method = 'GET';
5858
5959
form.innerHTML = '<input name="q" value="test">';
6060
61-
// the form must be in the document to submit it
61+
// ফর্মটি সাবমিট করার জন্য অবশ্যই এটি ডকুমেন্টের নোড হতে হবে
6262
document.body.append(form);
6363
6464
form.submit();

0 commit comments

Comments
 (0)