質問編集履歴

3

ajaxを追加

2019/02/20 02:17

投稿

mizore
mizore

スコア13

test CHANGED
File without changes
test CHANGED
@@ -44,6 +44,12 @@
44
44
 
45
45
 
46
46
 
47
+
48
+
49
+ ##view(output.ctp)
50
+
51
+
52
+
47
53
  ---
48
54
 
49
55
  **input箇所**
@@ -51,6 +57,44 @@
51
57
  <?php echo $this->F->input("input_date",array('type' => 'date', 'dateFormat' => 'YMD','monthNames' => false, 'id' => 'inputDateId'));?>
52
58
 
53
59
 
60
+
61
+ ---
62
+
63
+ **ajaxPOST送信箇所**
64
+
65
+
66
+
67
+ <script>
68
+
69
+ var y = $('#inputDateIdYear').val(); //年
70
+
71
+ var m = $('#inputDateIdMonth').val(); //月
72
+
73
+ var d = $('#inputDateIdDay').val(); //日
74
+
75
+
76
+
77
+ $.ajax({
78
+
79
+ type:"post",
80
+
81
+ url:"<?php echo [output.ctpを指定] ?>",
82
+
83
+ data:[y,m,d]
84
+
85
+ success: function(ret){
86
+
87
+ console.log(ret);
88
+
89
+ },
90
+
91
+ error:function(XMLHttpRequest, textStatus, errorThrown){
92
+
93
+ }
94
+
95
+ });
96
+
97
+ </script>
54
98
 
55
99
 
56
100
 

2

input要素にidの追加

2019/02/20 02:16

投稿

mizore
mizore

スコア13

test CHANGED
File without changes
test CHANGED
@@ -48,7 +48,7 @@
48
48
 
49
49
  **input箇所**
50
50
 
51
- <?php echo $this->F->input("input_date",array('type' => 'date', 'dateFormat' => 'YMD','monthNames' => false));?>
51
+ <?php echo $this->F->input("input_date",array('type' => 'date', 'dateFormat' => 'YMD','monthNames' => false, 'id' => 'inputDateId'));?>
52
52
 
53
53
 
54
54
 

1

2019/02/20 00:20

投稿

mizore
mizore

スコア13

test CHANGED
File without changes
test CHANGED
@@ -48,7 +48,7 @@
48
48
 
49
49
  **input箇所**
50
50
 
51
- <?php echo $this->F->input("input_date",array('type' => 'date', 'dateFormat' => 'YMD','monthNames' => false, ));?>
51
+ <?php echo $this->F->input("input_date",array('type' => 'date', 'dateFormat' => 'YMD','monthNames' => false));?>
52
52
 
53
53
 
54
54