回答編集履歴
1
記述例を見つけたため、追記。
answer
CHANGED
@@ -4,4 +4,14 @@
|
|
4
4
|
|
5
5
|
[HTMLFormElement: submit イベント - Web API | MDN](https://developer.mozilla.org/ja/docs/Web/API/HTMLFormElement/submit_event)
|
6
6
|
|
7
|
-
なのでおそらく `$this->Form->create()` のところに記述する必要があると推測します。
|
7
|
+
なのでおそらく `$this->Form->create()` のところに記述する必要があると推測します。
|
8
|
+
|
9
|
+
【追記】
|
10
|
+
古い記事のため、現在のバージョンで状況が変わっているかもしれませんが、例を見つけました。
|
11
|
+
|
12
|
+
[forms - CAKEPHP Confirming on Submit - Stack Overflow](https://stackoverflow.com/questions/21586935/cakephp-confirming-on-submit)
|
13
|
+
|
14
|
+
```php
|
15
|
+
$this->Form->create('Shift', array(
|
16
|
+
'onsubmit' => "return confirm(\"Creating shift for '$id' on \");"
|
17
|
+
```
|