Question:
How to make a default value in html?
2009-01-17 20:03:46 UTC
I was trying to change the default value of file name, but it wouldn't work.

check out this HTML code

########################################################


########################################################
Three answers:
ono
2009-01-17 21:36:58 UTC
You can't set a default value on an input of type "file".



Think about it: if you could put your own value in there, then you could put in the path of a file that most people have, and upload it to your server automatically by submitting the form with JavaScript. Very bad. So it's not allowed.
?
2016-12-13 00:25:46 UTC
in case you decide directly to place a default fee right into a text cloth field, you basically set the fee field to a pair string like: fee="Default text cloth". this might initialize the text cloth field to have the words "Default text cloth" interior them whilst the internet site a lot. in case you're finding to apply some form of variable, you're actually not previous the skill of the (X)HTML language. seem into JavaScript or very own homestead page for the variety of ability.
Albert E
2009-01-17 20:07:36 UTC
Because of security implications (scripts setting the value, and then attempting to retrieve files of your computer) the value of the fileupload form field is read only. Therefore you cannot set, or reset the value.



EDIT: Which part of "you cannot set, or reset the value" you don't understand, Einstein?


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...