我正在使用 jQuery 為管理面板制作 CRUD。我正在使用以下表格將“視頻”添加到列表中:因此,當我提交表單時,所有字段都被推送到一個名為videos的數組中,并且表單被清除。當我嘗試編輯特定視頻并嘗試將當前視頻的所有值插入表單的字段時,問題就開始了。我正在這樣做:$('#video-title').val(video.videoTitle);$('#video-segment').val(video.videoSegment);$('#video-thumbnail').val(video.videoThumbnail);$('#datepicker3').val(video.videoDate);$('#video-description').val(video.videoDescription);$('#bright-id').val(video.videoBrightCoveId);一切正常,但在視頻縮略圖(為該特定視頻上傳的圖像)給我這個錯誤:jquery.min.js:2 Uncaught DOMException: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string. at HTMLInputElement.<anonymous> (https://localhost:5001/lib/jquery/jquery.min.js:2:68568) at Function.each (https://localhost:5001/lib/jquery/jquery.min.js:2:2777) at k.fn.init.each (https://localhost:5001/lib/jquery/jquery.min.js:2:1419) at k.fn.init.val (https://localhost:5001/lib/jquery/jquery.min.js:2:68263) at HTMLButtonElement.<anonymous> (https://localhost:5001/admin/events/create:1239:35) at HTMLTableSectionElement.dispatch (https://localhost:5001/lib/jquery/jquery.min.js:2:42571) at HTMLTableSectionElement.v.handle (https://localhost:5001/lib/jquery/jquery.min.js:2:40572)我的問題是:有一種方法可以編輯縮略圖字段嗎?還是我這樣做的方式不可能?.
我可以使用 val() 插入或編輯文件輸入嗎?
慕娘9325324
2022-06-16 10:36:14