You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 2-ui/4-forms-controls/4-forms-submit/article.md
+24-23Lines changed: 24 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,27 @@
1
-
# Form submission: event and method submit
1
+
# Form gönderme: Olay veya metod olarak
2
2
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.
4
4
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.
6
6
7
-
Let's see more details of them.
7
+
Daha fazla ayrıntı görelim.
8
8
9
-
## Event: submit
9
+
## Olay olarak submit kullanımı
10
10
11
-
There are two main ways to submit a form:
11
+
Form göndermenin iki ana yolu vardır:
12
12
13
-
1.The first -- to click `<input type="submit">`or`<input type="image">`.
14
-
2.The second -- press `key:Enter` on an input field.
2.İkincisi -- bir giriş alanında (input) `key:Enter`a basmak.
15
15
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.
17
16
18
-
In the form below:
19
-
1. Go into the text field and press `key:Enter`.
20
-
2. Click `<input type="submit">`.
21
17
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.
23
25
24
26
```html autorun height=60 no-beautify
25
27
<formonsubmit="alert('submit!');return false">
@@ -28,28 +30,27 @@ Both actions show `alert` and the form is not sent anywhere due to `return false
28
30
</form>
29
31
```
30
32
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.
33
35
34
-
That's rather funny, because there was no click at all.
36
+
Bu oldukça komik çünkü hiç tıklama yoktu.
35
37
36
-
Here's the demo:
38
+
Örnek:
37
39
```html autorun height=60
38
40
<formonsubmit="return false">
39
-
<inputtype="text"size="30"value="Focus here and press enter">
41
+
<inputtype="text"size="30"value="Buraya tıkla ve birşeyler yaz sonra enter'e bas">
To submit a form to the server manually, we can call `form.submit()`.
48
+
## Metod olarak submit kullanımı
49
49
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.
51
51
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:
0 commit comments