Input tag file value jquery

Ruwan Jayawardena

I used bootstrap 3 model to upload image, when I get value in file field in console I got

$('input[type="file"]').val(); // = "C:\fakepath\maxresdefault.jpg"

but after send data some time I get value in console

$('input[type="file"]').val(); // = ""

I got bad result. Whats the problem, but I selected image .and we can see image name in file field but result was empty.how can fix it

tonoslfx

try this:

<input type="file" name="uploader" id="uploader">

$(function(){
   $('#uploader').change(function(){
     console.log(this.value);
   });
});

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

input type date, jQuery val() returns element tag and not value

분류에서Dev

JQuery Select Input By Value

분류에서Dev

Add value of input field to anchor/link tag

분류에서Dev

jQuery push multiple values in input tag

분류에서Dev

get value of input tag from td tag generated by for loop

분류에서Dev

jQuery if/else based on input value

분류에서Dev

How pass javascript function value into input tag value?

분류에서Dev

extract xml tag value from the file to Variable

분류에서Dev

how to access input tag in form with jquery?(include hidden type)

분류에서Dev

Change input value depending on list order in jQuery

분류에서Dev

Jquery copy input value to other forms

분류에서Dev

setting a text input value via jquery mobile

분류에서Dev

jquery - change input value when go to next

분류에서Dev

Jquery checking the upload filename in file type input

분류에서Dev

How to get tag value from input XML where tag name is stored in a variable

분류에서Dev

Insert string to <input> tag

분류에서Dev

Setting Default value of input textbox in Jquery EasyUI dialog

분류에서Dev

Issues getting value from hidden input field with jQuery

분류에서Dev

JQuery assigning a value to an input text via each loop

분류에서Dev

Get value of hidden input using jquery parent function

분류에서Dev

How to get the name's value from a input in jquery

분류에서Dev

jQuery-<input value = "">에 값 삽입

분류에서Dev

Find closest input value and copy to the rest of the cells in the column jquery

분류에서Dev

jQuery - Appending images after input field based on value

분류에서Dev

How to Check value id from Tag Input and remove count row is 0?

분류에서Dev

How to replace input text tag into plain text of it's value using C# regex?

분류에서Dev

How to send input file data value using ajax to a php page

분류에서Dev

Trying to pass UIButton's tag value when calling UIViewController from .xib file in iOS

분류에서Dev

JSP Tag file that outputs the result (return value) to a variable instread of printing it out

Related 관련 기사

  1. 1

    input type date, jQuery val() returns element tag and not value

  2. 2

    JQuery Select Input By Value

  3. 3

    Add value of input field to anchor/link tag

  4. 4

    jQuery push multiple values in input tag

  5. 5

    get value of input tag from td tag generated by for loop

  6. 6

    jQuery if/else based on input value

  7. 7

    How pass javascript function value into input tag value?

  8. 8

    extract xml tag value from the file to Variable

  9. 9

    how to access input tag in form with jquery?(include hidden type)

  10. 10

    Change input value depending on list order in jQuery

  11. 11

    Jquery copy input value to other forms

  12. 12

    setting a text input value via jquery mobile

  13. 13

    jquery - change input value when go to next

  14. 14

    Jquery checking the upload filename in file type input

  15. 15

    How to get tag value from input XML where tag name is stored in a variable

  16. 16

    Insert string to <input> tag

  17. 17

    Setting Default value of input textbox in Jquery EasyUI dialog

  18. 18

    Issues getting value from hidden input field with jQuery

  19. 19

    JQuery assigning a value to an input text via each loop

  20. 20

    Get value of hidden input using jquery parent function

  21. 21

    How to get the name's value from a input in jquery

  22. 22

    jQuery-<input value = "">에 값 삽입

  23. 23

    Find closest input value and copy to the rest of the cells in the column jquery

  24. 24

    jQuery - Appending images after input field based on value

  25. 25

    How to Check value id from Tag Input and remove count row is 0?

  26. 26

    How to replace input text tag into plain text of it's value using C# regex?

  27. 27

    How to send input file data value using ajax to a php page

  28. 28

    Trying to pass UIButton's tag value when calling UIViewController from .xib file in iOS

  29. 29

    JSP Tag file that outputs the result (return value) to a variable instread of printing it out

뜨겁다태그

보관