-1

How to edit input type="file" value="" area... I want to upload my custom file.

My Sample:

<form ENCTYPE="multipart/form-data" action="xmlupload"  method="post" name="form1" id="form1" >

<input type="file" name="xmlupload" value="myCustom.xml" /> 

<input type="button" name="btnSubmit" value="send" onclick="form1.submit();">
</form>

How to edit type=file value="" (javascript or html) ?

fast
  • 1
  • 3
  • value is not a permitted attribute for that https://www.w3.org/TR/html-markup/input.file.html – Funk Doc Mar 11 '16 at 15:38
  • Since your NAA said: '*How to edit file value area? "value" does not work on browser*' this is a duplicate of [Remember and Repopulate File Input](http://stackoverflow.com/questions/20537696/remember-and-repopulate-file-input) – GitaarLAB Mar 12 '16 at 19:44

1 Answers1

0

This can be done by using .attr() jQuery or setAttribute() javascript

Example 1 - jQuery

$('input[name=xmlupload]').attr("type", "SPECIFY TYPE HERE");

Example 2 - Javascript

var yourinput = document.getElementsByName("xmlupload").setAttribute("type", "SPECIFY TYPE HERE")

These methods should work to set any attribute.

KpTheConstructor
  • 3,153
  • 1
  • 14
  • 22