Hoa
Hoa

Reputation: 20448

How can I set the value of my HTML button?

I have tried the following

<input type="file" name="upload" multiple="multiple" value="MyText">

However the text on my button still reads 'Choose Files'. What am I doing wrong?

Upvotes: 1

Views: 193

Answers (3)

Jonas T
Jonas T

Reputation: 3077

Input type="file" is pre-defined by the browser. You can't change it but if you want to try, there is a good article here.

http://www.quirksmode.org/dom/inputfile.html

Upvotes: 0

TechGuy
TechGuy

Reputation: 4570

Values uses for Text input purpose.Buttons input type is Submit.You can use javascript for this.

Upvotes: 1

leopic
leopic

Reputation: 3012

Value only works for text inputs, buttons and input with a type of sumbit, you really can't tweak the input type file without some javascript.

Upvotes: 0

Related Questions