View Single Post
  #4  
Old 10-20-2008, 06:35 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Sorry I misunderstood the question.

You'd do that in javascript. I will post an example in a minute.

Code:
<script language="javascript">

var attachbutton = document.getElementById("addextraattach");

if (attachbutton)
{
  attachbutton.onclick = addField;
}

function addField()
{

var attachBox = document.createElement("input");
attachBox.type = "file";
attachBox.name = "attachments[]";

var attachments = document.getElementById("attachmentdiv");
if (attachments)
{
attachments.appendChild(attachbox);
}
}
</script>
<form action="phMailer.php" method="post" enctype="multipart/form-data">
<p>Attachments
<input type="file" name="pictures[]" />
<div id="attachmentdiv"></div><input type="button" value="Add Another Attachment" id="addextraattach" />
<input type="submit" value="Send" />
</p>
</form>
__________________

Last edited by atholon; 10-20-2008 at 06:51 PM.
Reply With Quote