[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.4

Generate form fields from a drop down menu

Asked by InnerChild in JavaScript

Tags: Java Script, Ajax, PHP

Initially I had the following questions going  http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_23335795.html#discussion
What this solution provides is that when a person selects a number in the drop down then some form elements are dynamically created.

The problem I am having is that when submitting the form the only information that is being parsed is the number that is selected and not the information that is entered into the text boxes.

Also I now need to add a radio group as well to the group of elements that are created.

So as an example......

A Person clicks on 2 in the drop down then the fields that need to be dynamically created are...
Person 1 name
Person 1 email
Person 1 radio group
option 1
option 2
option 3

Person 2 name
Person 2 email
Person 2 radio group
option 1
option 2
option 3

And all the information entered submitted (name, email, and the option chosen) via email.
Thanks,


IC
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:
58:
59:
60:
61:
62:
63:
64:
65:
<!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" lang="en">
<head>
<link href="/style.css" rel="stylesheet" type="text/css" />
<title>Custom contact page</title>
<script type="text/javascript">
function chkContacts(ele) {
	var div = document.getElementById('contactList');
	div.innerHTML = "";
	for (var i=1; i<=ele; i++) {
		addContact(i, div);
	}
	div.style.display = "";
}
function addContact(num, div) {
	var contact = document.createElement('p');
	var textName = document.createTextNode('Contact #' + num + ' Name: \n');
	var contactName = document.createElement('input');
	contactName.type = 'text';
	contactName.name = 'contactName' + num;
	contactName.id = 'contactName' + num;
	var br = document.createElement('br');
	var textEmail = document.createTextNode('Contact #' + num + ' Email: \n');
	var contactEmail = document.createElement('input');
	contactEmail.type = 'text';
	contactEmail.name = 'contactEmail' + num;
	contactEmail.id = 'contactEmail' + num;
	contact.appendChild(textName);
	contact.appendChild(contactName);
	contact.appendChild(br);
	contact.appendChild(textEmail);
	contact.appendChild(contactEmail);
	div.appendChild(contact);
}
</script>
</head>
 
<body>
<h3>Page for contact info</h3>
 
<br /><br />
<form action="contact.php" method="post" />
Select number of contacts:
<select name="nContacts" onchange="chkContacts(this.value);">
<option value="0">--Choose--</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
</select>
<br /><br />
<div id="contactList" style="display: none;"></div>
<br /><br />
<input type="submit" value="Send" />
</form>
 
 
</body>
</html>
[+][-]04/28/08 11:53 AM, ID: 21456582Author 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.

 
[+][-]04/29/08 08:28 AM, ID: 21463183Author 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.

 
[+][-]04/29/08 06:33 PM, ID: 21467539Expert 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.

 
[+][-]04/29/08 08:00 PM, ID: 21467822Author 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.

 
[+][-]04/30/08 12:04 AM, ID: 21468619Expert 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.

 
[+][-]04/30/08 06:36 AM, ID: 21470543Author 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.

 
[+][-]04/30/08 10:30 AM, ID: 21472832Author 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.

 
[+][-]04/30/08 04:20 PM, ID: 21475394Accepted 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

Zone: JavaScript
Tags: Java Script, Ajax, PHP
Sign Up Now!
Solution Provided By: b0lsc0tt
Participating Experts: 1
Solution Grade: A
 
 
Loading Advertisement...
20091021-EE-VQP-81 / EE_QW_2_20070628