[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[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!

9.1

JQuery clone with inner child element clone - This noob is confused!

Asked by trickyidiot in Jquery, JavaScript Frameworks, Asynchronous Javascript and XML (AJAX)

Tags: jquery, ajax, js, clone, cloned, child, parent, element

I have a patent element, a div with form elements within is that needs to be able to be cloned, which I have working properly.

Within that clone-able parent div is an additional form piece that needs to be able to be cloned as well, but still somehow tied to that parent.

I am new to JQuery and and getting confused. Would someone please be so kind as to explain to me where I am going wrong here and how I can fix this?

Thank you
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  <title>kjhgkjhg</title>
	<script src="http://www.google.com/jsapi"></script>
	<script>
		google.load("jquery", "1.3.2");
		google.load("jqueryui", "1.7.2");
	</script>
</head>
<body>
<div id="wrapper">
	<div id="content">
<script type="text/javascript">
	$(document).ready(function() {
		$('.btnAddTitle').live('click', function() {
			var num     = $('.clonedInput').length;
			var newNum  = new Number(num + 1);
			var newElem = $('#AdditionalInfoItemTitle' + num).clone().attr('id', 'AdditionalInfoItemTitle' + newNum);
			newElem.children(':first').attr('id', 'addDailyDealFormAdditionalInfoItemTitle' + newNum).attr('addDailyDealFormAdditionalInfoItemTitle', 'addDailyDealFormAdditionalInfoItemTitle' + newNum);
			$('#AdditionalInfoItemTitle' + num).after(newElem);
			$('#AdditionalInfoItemTitle' + num).after(newElem);
		});
		$('.btnAddValue').live('click', function() {
			var num     = $('.parentID').value;
			var newNum  = new Number(num + 1);
			var newElem = $('#AdditionalInfoItemValue' + num + '[]').clone().attr('id', 'AdditionalInfoItemValue' + newNum + '[]');
			newElem.children(':first').attr('id', 'addDailyDealFormAdditionalInfoItemValue' + newNum + '[]').attr('addDailyDealFormAdditionalInfoItemValue', 'addDailyDealFormAdditionalInfoItemValue' + newNum + '[]');
			$('#AdditionalInfoItemValue' + num + '[]').after(newElem);
		});
	});
</script>
<form method="post" action="index.php" name="addNewDailyDeal">
	<h4>Additional Info Items</h4>
	<div id="AdditionalInfoItemTitle1" class="clonedInput">
		<select name="addDailyDealFormAdditionalInfoItemTitle1">
			<option value="1">Features</option>
			<option value="2">Warranty</option>
			<option value="3">Specifications</option>
			<option value="4">In the box</option>
			<option value="5">Dimensions</option>
			<option value="6">Connections</option>
			<option value="7">Interfaces</option>
		</select>
		<input type="button" class="btnAddTitle" value="+" />
		<div id="AdditionalInfoItemValue1" class="clonedInputValue">
			<input type="hidden" class="parentID" name="parentID" value="1" />
			<textarea name="addDailyDealFormAdditionalInfoItemValue1[]" rows="2" cols="30"></textarea>
			<input type="button" class="btnAddValue" value="+" />
		</div>
	</div>
</form>
	</div>
	</div>
</body></html>
[+][-]10/29/09 03:27 PM, ID: 25698870Accepted Solution

View this solution now by starting your 30-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

Zones: Jquery, JavaScript Frameworks, Asynchronous Javascript and XML (AJAX)
Tags: jquery, ajax, js, clone, cloned, child, parent, element
Sign Up Now!
Solution Provided By: amit_g
Participating Experts: 1
Solution Grade: A
 
[+][-]10/29/09 09:23 AM, ID: 25695333Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/29/09 12:09 PM, ID: 25697121Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/29/09 01:12 PM, ID: 25697753Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/29/09 01:28 PM, ID: 25697908Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/29/09 01:58 PM, ID: 25698199Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/29/09 02:05 PM, ID: 25698261Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20080625