Skip to content

Commit 39cdcfd

Browse files
licxiskyjxlwqq
authored andcommitted
修复 json-editor 无法提交数据的BUG
1 parent 8afe2f7 commit 39cdcfd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

resources/views/editor.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<div id="{{$id}}" style="width: 100%; height: 100%;"></div>
1111

12-
<input type="hidden" name="{{$name}}" value="{{ old($column, $value) }}" />
12+
<input type="hidden" id="{{$id}}_input" name="{{$name}}" value="{{ old($column, $value) }}" />
1313
@include('admin::form.help-block')
1414

1515
</div>

src/Editor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function render()
4747
// get json
4848
$('button[type="submit"]').click(function() {
4949
var json = editor.get()
50-
$('input[name={$this->id}]').val(JSON.stringify(json))
50+
$('input[id={$this->id}_input]').val(JSON.stringify(json))
5151
})
5252
EOT;
5353

0 commit comments

Comments
 (0)