0

I attempted to add new row but it does not seem too work. Did I do something wrong?

Pricing.html

<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT SRC="jquery-1.7.1.js" LANGUAGE="text/javascript"></SCRIPT>
<SCRIPT SRC="addRow.js" LANGUAGE="text/javascript"></SCRIPT>
</HEAD>
<BODY>
<TABLE>
<THEAD>
<TR>
<TH bgcolor="#33CC00">Select</TH>
<TH bgcolor="#33CC00">Quantity</TH>
<TH bgcolor="#33CC00">Inner Packaging</TH>
<TH bgcolor="#33CC00">Quantity</TH>
<TH bgcolor="#33CC00">Outer Packaging</TH>
<TH bgcolor="#33CC00">Price</TH>
<TH bgcolor="#33CC00">Minimum Order</TH>
</TR>
</THEAD>
<TBODY>
</TBODY>
</TABLE>
<input type='submit' value='Add Row' id='addRow' />
</BODY>
</HTML>

AddRow.js

$(document).ready(function(){
    $('input#addRow').click(function($e){						  
		$e.preventDefault();
        $('TABLE TBODY')[0].innerHTML += 
		"<TR>" +
		"<TD><INPUT TYPE='checkbox' name='index0'></TD>" +
		"<TD><INPUT TYPE='text' name='index1'></TD>" +
        "<TD><SELECT name='index2'><OPTION VALUE='bottle'>bottle</OPTION><OPTION VALUE='bag'>bag</OPTION>" +
        "<OPTION VALUE='jars'>jars</OPTION></SELECT></TD>" +
		"<TD><INPUT TYPE='text' name='index3'></TD>" +
		"<TD><SELECT name='index4'><OPTION VALUE='ctn'>ctn</OPTION>" +
        "<OPTION VALUE='case'>case</OPTION></SELECT></TD>" +
		"<TD><INPUT TYPE='text' name='index5'></TD>" +
		"<TD><INPUT TYPE='text' name='index6'></TD>" +
		"</TR>";
    });
});
1
Contributor
1
Reply
3
Views
5 Years
Discussion Span
Last Post by solomon_13000
0

I found the solution:

<SCRIPT SRC="jquery-1.7.1.js" LANGUAGE="text/javascript"></SCRIPT>
<SCRIPT SRC="addRow.js" LANGUAGE="text/javascript"></SCRIPT>

REPLACE

<SCRIPT SRC="jquery-1.7.1.js" TYPE="text/javascript"></SCRIPT>
<SCRIPT SRC="addRow.js" TYPE="text/javascript"></SCRIPT>

Edited by solomon_13000: n/a

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.