Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


help, why does this code doesn't work on Mozilla Firefox??&l



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> JavaScript Forum
View previous topic :: View next topic  
Author Message
nebchill26



Joined: 26 May 2008
Posts: 2

PostPosted: Mon May 26, 2008 4:05 am    Post subject: help, why does this code doesn't work on Mozilla Firefox??&l Reply with quote

can anyone help me?i found this code on the internet im just a beginner just want to ask some one to help me make this code work on other browsers...it only works on I.E. 6, what i want is to make it work on Firefox and other browsers.. Here's the code

Code:


<html>
<head>
      <title>Test Page</title>

      <script language="JavaScript" type="text/javascript">
     
  var textId = 2;

  function addInput(tblId)
  {
  var tbl = document.getElementById(tblId);

  var row = tbl.insertRow();
  var cell = row.insertCell();

  var input = document.createElement("<INPUT NAME=\"text" + textId + "\">");

  var btn = document.createElement("INPUT");

  btn.type = "button";
  btn.value = "Delete";
  btn.onclick = new Function("document.getElementById(\"" + tblId + "\").deleteRow(window.event.srcElement.parentElement.parentElement.rowIndex);");

  cell.appendChild(input);

  cell.innerHTML += "&nbsp;";

  cell.appendChild(btn);

  textId++;
  }
     
      </script>
</head>

<body>
      <form action="getvalues.php" method="POST">
            <table id="tbl">
                  <tr>
                        <td>
    <input type="text" id="text1" name="text1"> <input type="button" value="Add" onclick="addInput('tbl');">
                        </td>
                  </tr>
                 
            </table>
            <input type="submit" value="Save">
      </form>
</body>
</html>
[/quote]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> JavaScript Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap