Skip to content

Commit 4ae48eb

Browse files
authored
Merge pull request #154 from yy34/patch-4
update article.md
2 parents 9d51eae + cbcb253 commit 4ae48eb

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

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

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
# Form submission: event and method submit
1+
# Form gönderme: Olay veya metod olarak
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+
Form gönderildiğinde `submit` olayı tetiklenir, genellikle formu sunucuya göndermeden önce doğrulamak veya gönderimi iptal edip JavaScript'te işlemek için kullanılır.
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()` metodu JavaScript'ten form gönderimini başlatmaya izin verir. Kendi formlarımızı dinamik olarak oluşturmak ve sunucuya göndermek için kullanabiliriz.
66

7-
Let's see more details of them.
7+
Daha fazla ayrıntı görelim.
88

9-
## Event: submit
9+
## Olay olarak submit kullanımı
1010

11-
There are two main ways to submit a form:
11+
Form göndermenin iki ana yolu vardır:
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. Birincisi -- `<input type="submit">` veya `<input type="image">` alanlarına tıklamak.
14+
2. İkincisi -- bir giriş alanında (input) `key:Enter`a basmak.
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.
1716

18-
In the form below:
19-
1. Go into the text field and press `key:Enter`.
20-
2. Click `<input type="submit">`.
2117

22-
Both actions show `alert` and the form is not sent anywhere due to `return false`:
18+
Her iki eylem de formda olay gönderilmesine yol açar. İşleyici verileri kontrol edebilir ve hata varsa bunları gösterebilir ve `event.preventDefault()` öğesini çağırabilir, bu durumda form sunucuya gönderilmez.
19+
20+
Aşağıdaki formda:
21+
1. Metin alanına gidin ve `key:Enter` tuşuna basın.
22+
2. Tıklayın `<input type="submit">`
23+
24+
Her iki eylem de `alert` gösterir ve `return false` olduğu için form hiçbir yere gönderilmez.
2325

2426
```html autorun height=60 no-beautify
2527
<form onsubmit="alert('submit!');return false">
@@ -28,28 +30,27 @@ Both actions show `alert` and the form is not sent anywhere due to `return false
2830
</form>
2931
```
3032

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">`.
33+
````smart header="`submit` ve `click` arasındaki ilişki"
34+
Bir input alanında `key:Enter` kullanılarak bir form gönderildiğinde, `<input type="submit">` üzerinde bir `click` olayı tetiklenir.
3335

34-
That's rather funny, because there was no click at all.
36+
Bu oldukça komik çünkü hiç tıklama yoktu.
3537

36-
Here's the demo:
38+
Örnek:
3739
```html autorun height=60
3840
<form onsubmit="return false">
39-
<input type="text" size="30" value="Focus here and press enter">
41+
<input type="text" size="30" value="Buraya tıkla ve birşeyler yaz sonra enter'e bas">
4042
<input type="submit" value="Submit" *!*onclick="alert('click')"*/!*>
4143
</form>
4244
```
4345

44-
````
4546

46-
## Method: submit
4747

48-
To submit a form to the server manually, we can call `form.submit()`.
48+
## Metod olarak submit kullanımı
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+
Sunucuya manuel olarak bir form göndermek için, `form.submit()` metodunu kullanabiliriz.
5151

52-
Sometimes that's used to manually create and send a form, like this:
52+
Sonra herhangi bir `submit` olayı oluşturulmaz. Programcı `form.submit()` 'i çağırırsa, komut dosyasının tüm ilgili işlemleri zaten yaptığı varsayılır.
53+
Bazen bu, aşağıdaki gibi bir formu manuel olarak oluşturmak ve göndermek için kullanılır:
5354

5455
```js run
5556
let form = document.createElement('form');

0 commit comments

Comments
 (0)