Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default DOM Error in internet explorer

Hi All,

I need the following problem to be solved in internet explorer
(working fine in firefox). Please copy the code and check it in the
internet explorer.
Please click the link addmore and try to submit the form. Then you can
see the javascript error. I need to fix this problem, so please
explain me in this regards.

---------------------------------------------------------------------------------------------------
<html
<head
<titleremoveChild() Example</title
<script type="text/javascript"
function resetForm() {

alert(document.getElementById('noFiles').value);
document.getElementById('noFiles').value = '';
document.getElementById('noFiles').value = 1;
}
function frmvalidate(type,id)
{
//alert(document.venueform.noFiles.value)
var lastRow = document.venueform.noFiles.value;
for(file_number=1;file_number<=lastRow;file_number ++)
{
//alert(file_number);
var file_element = eval("document.venueform.fileName_"+file_number
+".value");
alert(file_element);
if(file_element != "" && file_element.indexOf(".jpg")== -1 &&
file_element.indexOf(".JPG") == -1 && file_element.indexOf(".jpeg") ==
-1 )
{
alert("Please upload JPEG images only");
return false;
}
}
}
function addFileTab()
{
oTBody = document.getElementById("addFileVenueId");
document.venueform.noFiles.value =
parseInt(document.venueform.noFiles.value) + 1;
var lastRow = document.venueform.noFiles.value

//var hidden_value = lastRow ;
//var lastRow = parseInt(lRow) - 1;

if(lastRow <= 5 )
{
oTBody.insertRow(lastRow);
// var file_name = "fileName"+lastRow;
var oinput = document.createElement("input");
oinput.setAttribute("type", "file");
oinput.setAttribute("class", "textbox");
oinput.setAttribute("size", "25");
oinput.setAttribute("name", "fileName_"+lastRow);
// oinput.setAttribute("id", file_name);
oTBody.rows[lastRow].insertCell(0);
oTBody.rows[lastRow].cells[0].align = "left";
// oTBody.rows[lastRow].cells[0].setAttribute("class","litetd");
oTBody.rows[lastRow].cells[0].className="darktd";
oTBody.rows[lastRow].cells[0].setAttribute("colspan","2");
oTBody.rows[lastRow].cells[0].appendChild(oinput);


//document.venueform.noFiles.value =
parseInt(document.venueform.noFiles.value) + 1;

//alert(document.venueform.noFiles.value);
//document.getElementById("noFiles").value = hidden_value;

if(lastRow == 5)
document.getElementById("add_row").style.visibilit y = "hidden";

/*if(lastRow == 2)
document.getElementById("delete_row").style.visibi lity = "visible";
*/

}
}
</script
</head
<body onload='resetForm()'<form name=venueform
<table width='50%' border='0' align='center' id='addFileVenueId'
cellspacing=1 cellpadding=0
<tr align='center' class='rowhead'
<th height='20' colspan='2' class='headrow'Upload Photo upto
nos</th
<td
<span id='add_row'
<a href='javascript:;' onclick='addFileTab()'Add more</a</span
</td
</tr
<tr
<td colspan='2' align='left' class='darktd'
<input type='file' name='fileName_1' id='fileName1'
class='textbox' size='25'
</td
</tr
<tr
<td
<input type='button' value='Add' class='button' onClick="return
frmvalidate()"
<input type='hidden' name='noFiles' value='1' id='noFiles'
</td
</tr

</table
</form
</body
</html

---------------------------------------------------------------------------------------------------

Thanks in Advance.

Regards,
Srinivasan M

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Explorer da Excel Discussion (Misc queries) 4 October 9th 08 09:31 PM
Run-Time Error 91 for Internet Explorer .elements(name).value [email protected] Excel Programming 3 October 24th 06 05:46 PM
Excel/VBA/Internet Explorer Alex[_30_] Excel Programming 1 November 22nd 05 05:09 PM
error in script from internet explorer fred6529 Excel Discussion (Misc queries) 0 June 11th 05 08:43 PM
internet explorer doris Excel Discussion (Misc queries) 1 January 5th 05 09:44 PM


All times are GMT +1. The time now is 12:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"