Advertisement

01.08.2004 at 10:53AM PST, ID: 20845195
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

Insert and delete table rows in IE and Mozilla

Asked by weversbv in JavaScript

Tags: , , ,

The following code will add and remove table rows.
However it is only working in Iexplorer.
How to make it work in Netscape/ Mozilla also (Would be nice if it should work in Opera also)?

<html>
<head>
      <title>Untitled</title>

      <script type="text/javascript">
      var inputCount = 0;
      function addLine() {
            var objSource = window.event.srcElement;
            var currentTR, currentTD, currentSelect, temp;

            //set row number
            inputCount++;
 
            //here we will delete the line
            while ( (objSource = objSource.parentElement)  && objSource.tagName !="TBODY");
 
            //add the tr to the table
            currentTR = objSource.insertRow();
            currentTR.bgColor = "red";
            currentTD = currentTR.insertCell();
            currentTD.innerHTML = "<input type='text' size='10' name='items_"+inputCount+"'>";
            currentTD = currentTR.insertCell();
            currentTD.innerHTML = "<input type='text' size='10' name='value_0'>";
            currentTD = currentTR.insertCell();
            currentTD.innerHTML = "<input type='Button' class='Button' onclick='removeLine()' value='Delete this line'>";
      }

      function removeLine() {
            var current = window.event.srcElement;
   
            //here we will delete the line
            while ( (current = current.parentElement)  && current.tagName !="TR");
                  current.parentElement.removeChild(current);
      }    
      </script>

</head>

<body>

<table bgcolor="#ffffff" border=0 cellspacing=1 cellpadding=3 id="myTable">
      <tr bgcolor="red" valign=top>
            <th>
                  Pieces<br />
            </th>
            <th>
                  Amount<br />
            </th>
            <th>
                  <input type="button" class="Button" onclick="addLine()" value="add a row"><br />
            </th>
      </tr>
      <tr bgcolor="red" valign=top>
            <td>
                  <input type="text" size="10" name="items_0" value="1"><br />
            </td>
            <td>
                  <input type="text" size="10" name="value_0">
            </td>
            <td>
                  <input type="Button" class="Button" onclick="removeLine()" value="Delete this line"><br />
            </td>
      </tr>
</table>

</body>
</html>
Start Free Trial
[+][-]01.08.2004 at 11:52AM PST, ID: 10074339

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: JavaScript
Tags: javascript, row, insert, table
Sign Up Now!
Solution Provided By: jaysolomon
Participating Experts: 4
Solution Grade: A
 
 
[+][-]01.08.2004 at 04:34PM PST, ID: 10076641

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.08.2004 at 06:55PM PST, ID: 10077455

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01.08.2004 at 07:48PM PST, ID: 10077713

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.08.2004 at 10:18PM PST, ID: 10078229

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.09.2004 at 03:49AM PST, ID: 10079311

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.09.2004 at 10:33PM PST, ID: 10085902

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.09.2004 at 11:55PM PST, ID: 10086015

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.10.2004 at 12:26AM PST, ID: 10086077

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.11.2004 at 04:40AM PST, ID: 10090433

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.11.2004 at 08:02AM PST, ID: 10091022

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.17.2004 at 01:38PM PST, ID: 10386556

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.21.2004 at 06:50AM PST, ID: 10420180

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]02.24.2004 at 08:29AM PST, ID: 10442184

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32