I have researched this topic to death but I have not found exactly what I need. Hopefully this discussion will help others as well.
Question: I am attempting to drag a picture from my desktop or folder and drop it into a textbox on my HTML page. The then result will list the filename. I really hope one of you can help me find a solution for my dilemma.
The closest solution to what I want to do is located at the following URL. I just haven't been able to implement either of them. Drag Drop Example!
Attempting to Implement:
<p id="1"> 1) Primary silkscreen layer <img src="../0_Images/blank.jpg" width="60" height="15"> File name:
<input name="Primary Silkscreen12" type="file" dropzone="copy file:image/png file:image/jpg file:image/jpeg" style="border:3px solid #1871D1;" size="60" />
</p>
Entire Code Condensed:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
/*
Common: #7100E1
CTO: #8B4513
HMP: #FF0000
RoHS: #009900
RX1: #CC6600
Snqb: #0066CC
*/
.bgcolor{background-color: #D2E8D2;}
.sidestopborder
{
border-style:solid solid none solid;
}
.sideborder
{
border-style:none solid none solid;
}
.BottomBorder
{
border-style:none none solid none;
font-family: Arial, Helvetica, sans-serif;
-height: 1.5em;
}
.Topborder
{
border-style:solid none none none;
}
.Rightborder
{
border-style:none solid none none;
}
.Leftborder
{
border-style:none none none solid;
}
.style2 {
font-family: Arial, Helvetica, sans-serif;
-height: 1.5em;
}
}
.style4 {font-family: Arial, Helvetica, sans-serif; -height: 1.6em; font-weight: bold; }
#block_container
#block1, #block2
{
display:inline;
}
#block3, #block4
{
display:inline;
}
#block5, #block6
{
display:inline;
}
#block7, #block8
{
display:inline;
}
</style>
<script>
att = $('#gal1_img1').attr('src');
$("a[rel*='lightbox[job1]']").attr('href',att);
</script>
</head>
<body onload='init()'>
<script type="text/javascript" src="file://///namp-dsk-003/cim-cam/CAM/BOI/Abi/680/Common_Files/jquery-1.11.1.js">
</script>
<table border="5" cellpadding="3" cellspacing="2">
<tr><td width="1822" align="center">
</td></tr>
<tr>
<td>
<p align="center" > </p>
</td>
</tr>
<tr>
<td><p class="style2" ><strong><em>Auto Board</em></strong></p>
<table width="100%" bordercolor="#990033">
<tr>
<td width="23%" rowspan="6" class="Rightborder" > </td>
<td width="61%" bordercolor="#B6DB90" bgcolor="#A0BFE2" class="Topborder"><p align="center"><span class="style2"><strong>INFORMATION</strong></span></p>
<p><br>
Date -- 02/24/11 </p></td>
<td width="16%" rowspan="6" class="Leftborder"> </td>
</tr>
<tr>
<td bgcolor="#A0BFE2"><p><br>
<br>
</p></td>
</tr>
<tr>
<td bgcolor="#A0BFE2"><div align="center" class="style4"> INFORMATION</div></td>
</tr>
<tr>
<td bgcolor="#A0BFE2"><div align="center"><span class="style2"><br>
<strong>DESCRIPTION</strong></span><br>
<br><br><br>
<div align="center"><strong>How many Layers (#) </strong></div>
<div align="center">
<input name="number" type="text" size="10" maxlength="5" onchange="test(this.value)" onfocusout="report(this.value)">
</div>
</td>
</tr>
<tr>
<td bordercolor="1871D1" bgcolor="#A0BFE2" class="style2">
** ARTWORK/PCB # 05126 REV C **
</p>
<script>
function report(period)
{
if (period=="1") { i = 4; do {+ i; i++; e = document.getElementById (i); e.style.display = 'none'} while (i < 50) }
if (period=="2") { i = 5; do {+ i; i++; e = document.getElementById (i); e.style.display = 'none'} while (i < 50) }}
function test(period)
{var i = period
var x=parseInt(i)+4;
var y=parseInt(i)+5;
var z=parseInt(i)+6;
var zz=parseInt(i)+7;
document.getElementById("block2").innerHTML = (x+")")
document.getElementById("block4").innerHTML = (y+")")
document.getElementById("block6").innerHTML = (z+")")
document.getElementById("block8").innerHTML = (zz+")")
}
</script>
<script>
function init() {
document.getElementById('x').addEventListener('drop', onDrop, true)
}
</script>
<p id="1"> 1) Primary silkscreen layer <img src="../0_Images/blank.jpg" width="60" height="15"> File name:
<input name="Primary Silkscreen12" type="file" dropzone="copy file:image/png file:image/jpg file:image/jpeg" style="border:3px solid #1871D1;" size="60" />
</p>
<p id="2"> 2) Primary soldermask layer <img src="../0_Images/blank.jpg" width="52" height="15"> File name:
<input name="Primary Silkscreen122" type="text" size="60" style="border:3px solid #1871D1;" /></p>
<!--5-->
<div > <div id="block2"></div>
Secondary side layer <img src="../0_Images/blank.jpg" width="80" height="15"> File name:
<input name="Primary Silkscreen1256" type="text" size="60" style="border:3px solid #1871D1;" /></div><br>
<!--6-->
<div > <div id="block4"></div>
Secondary soldermask layer <img src="../0_Images/blank.jpg" width="32" height="15"> File name:
<input name="Primary Silkscreen1257" type="text" size="60" style="border:3px solid #1871D1;" /></div><br>
<!--7-->
<div > <div id="block6"></div>
Secondary silkscreen layer1 <img src="../0_Images/blank.jpg" width="33" height="15"> File name:
<input name="Primary Silkscreen1258" type="text" size="60" style="border:3px solid #1871D1;" /></div><br>
<p>** FABRICATION DRAWINGS # 05126 REV C **</p>
<!--8-->
<div > <div id="block8"></div>
Fabriction Drawing <img src="../0_Images/blank.jpg" width="95" height="14"> File name:
<input name="Primary Silkscreen12259" type="text" size="60" style="border:3px solid #1871D1;" /></div><br>
***********************<br>
End of</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>