2015-05-14 21 views
0

我的代碼:如何通過引導來發送格式的文本輸入數據的FileInput

我用上傳引導fileinput.js

<input id="text" name="text" type="text" /> 
<input id="input-24" name="xls" type="file" multiple="true" multiple lass="file-loading"/> 
<script> 
$("#input-24").fileinput({ 
maxFileSize: 1000000000, 
maxFileCount: 1, 
allowedFileExtensions: ["xls"], 
uploadUrl: "<?=base_url('ajax/upxls')?>/"+  Math.round(Math.random()*56735345), 
uploadAsync: true, 
uploadExtraData: { 
file_id : Math.round(Math.random()*56735345), 
name: $("$text").val() 
} 

}); 
</script> 

這一部分:

name: $("$text").val() 

不會改變,發送一個字段中的默認值。

我想通過開始上傳發送文本字段值,但它不起作用。

回答

0

我不知道是否有一個jQuery選擇這樣

name: $("$text").val() 

要獲得VAL,使用id選擇

name: $("#text").val() 
上選擇

更多信息,你可以找到jQuery的doc

相關問題