troubleshooting Question

Limit the number of rows to 10 of my 'Add Row' function

Avatar of capturetheflag
capturetheflag asked on
JavaScriptjQuery
6 Comments1 Solution380 ViewsLast Modified:
I need to limit the number of rows I add to 10 in this function.
Thanks!
						$(document).on('click','#addAddOnDay',function(){
							var rowCount = $('#addOnDay tr').length + 1;
							var rowClass = (rowCount % 2 != 0) ? 'rowOdd' : 'rowEven';
							$('#addOnDay').append('<tr class="'+ rowClass +'"> \
																						<td align="center"><input type="text" class="text" style="width: 99%;" /></td> \
																						<td align="center"><input type="radio" name="4a_1"> <label>Yes</label> &nbsp; <input type="radio" name="4a_1" checked> <label>No</label></td> \
																						<td align="center">20000 or 95%</td> \
																						<td align="center" class="rollUpDisplay">1</td> \
																					</tr>');
						});
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros