-1

Hi friends,
Please help me with this, any javascript guy, Please >
this script is working in every browser except Internet Explorer.
It says an unknown runtime error ? :(

<script language="javascript">
var count=1;
function extend()
{
var a = "sname";
var b = "sgender";
var c = "sbranch";
var d = "sevents";
var formholder ="<tr><td>"+count+"</td><td></td><td><input type=text name="+a+count+" size=20 maxlength=150 ></td><td><input type=text name="+b+count+" size=5 maxlength=1 ></td><td><input type=text name="+c+count+" size=20 maxlength=150 ></td><td><input type=text name="+d+count+" size=35 maxlength=250 ></td></tr>";
ge = document.getElementById('abc');
ge.innerHTML += formholder;
count++;
}
</script>

HELP !!

2
Contributors
1
Reply
3
Views
7 Years
Discussion Span
Last Post by Airshow
0

Nothing immediately wrong but I suggest :

  • Avoid "extend". It's just possibly a reserved word (even though it's not part of the javascript language).
  • I guess that element '#abc' is a table. Try using <tbody id="abc">...</tbody> inside the table and add your row to it rather than directly to the table.
  • Use DOM methods to add the row rather than .html += . With this approach you will certainly need a <tbody>.

Airshow

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.