第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

fileinput.js thinkphp如何在后臺(tái)取到值?

fileinput.js thinkphp如何在后臺(tái)取到值?

九州編程 2018-10-18 13:15:32
是這樣的,我在模版上用了fileinput.js來上傳圖片,添加到數(shù)據(jù)庫(kù)什么的沒問題,問題是在更新數(shù)據(jù)表上。<input id="file1" class="file" type="file" value="{$res.cover}" multiple data-max-file-count="1" name="pic[]">發(fā)現(xiàn)thinkphp的upload,獲取不到原來存在的圖片,只有新添加的才能獲取到,這個(gè)該如何解決呢?
查看完整描述

1 回答

?
Cats萌萌

TA貢獻(xiàn)1805條經(jīng)驗(yàn) 獲得超9個(gè)贊

if( 不是 == {$res.cover}應(yīng)該是thinkphp的模板變量?) {

   我不知道,沒用過fileinput.js;

   exit;

}

file類型的輸入框,沒法獲取之前的值。

我的解決方式是:

<div id="parent">

  <input type="text" id="t_file" value="{$res.cover}" readonly>

  <input type="file" id="f_file" class="hide" name="pic[]" accept="image/*">

</div>

<style>

.hide{display:none;}

</style>

<script>

$('#t_file').click(function(){

    $(this).addClass('hide').siblings().removeClass('hide');

});

</script>


查看完整回答
反對(duì) 回復(fù) 2018-11-27
  • 1 回答
  • 0 關(guān)注
  • 1019 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)