File: /home/panama/public_html_old/managesite/js/addHTMLControls.js
// JavaScript Document
var arrInput = new Array(0);
var arrInputValue = new Array(0);
function addInput() {
arrInput.push(arrInput.length);
arrInputValue.push("");
display();
}
function display() {
document.getElementById('parah').innerHTML="";
for (intI=0;intI<arrInput.length;intI++) {
document.getElementById('parah').innerHTML+=createInput(arrInput[intI], arrInputValue[intI]);
}
}
function saveValue(intId,strValue) {
arrInputValue[intId]=strValue;
}
function createInput(id,value) {
// return "<input type='text' id='test "+ id +"' onChange='javascript:saveValue("+ id +",this.value)' value='"+ value +"'><br>";
return '<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td align="right" class="textbold" valign="top">PDF Title-1 </td>
<td colspan="2"><input name="pdftitle1" id="pdftitle1'+ id +'" type="text" class="required" value="'+value+'" size="40" /><br /><span class="error"> <?php echo $err_title1;?></span></td>
</tr>
<tr>
<td align="right" class="textbold" valign="top">PDF-1 </td>
<td colspan="2"><input name="firstpdf" id="firstpdf'+ id +'" type="file" class="filebrowse" size="40" /> <br /><span class="error"> <?php echo $err_pdf1;?></span></td>
</tr>';
}
function deleteInput() {
if (arrInput.length > 0) {
arrInput.pop();
arrInputValue.pop();
}
display();
}