blueindian1
Programmer
Hello All,
Let me tell you what I need to do. I have a form from which I need to caputre values to put into an email. Lets say the form looks like this:
Now after I post the form, I want to loop through the form elements and capture the values to put into the email. I will use the name for the form element as a label on the email with the value beside it, so the message might look something like this:
To: someone@somewhere.com
From: me@overhere.com
Subject: A Message
Input1: posted value of input 1
Input2: posted value of input 2
Input3: posted value of input 3
Input4: posted value of input 4
Now, what I want to do is generate this email by dynamically looping through the form elements. I don't want to have to hardcode a request for each element. So my question is, is there someway I can index the form elements to control the order they get looped on? In other words, I need to control the order in which the form elements are caputered. Basically, I need the subject of the email to look like this:
Input4: posted value of input 4
Input2: posted value of input 2
Input3: posted value of input 3
Input1: posted value of input 1
I hope this question makes sense, I've tried to make it as clear as I can.
Thanks in advance to anyone who can help
Rich
Let me tell you what I need to do. I have a form from which I need to caputre values to put into an email. Lets say the form looks like this:
Code:
<form name="formName" method="Post">
<input type="text" name="Input1">
<input type="text" name="Input2">
<input type="text" name="Input3">
<input type="text" name="Input4">
</form>
Now after I post the form, I want to loop through the form elements and capture the values to put into the email. I will use the name for the form element as a label on the email with the value beside it, so the message might look something like this:
To: someone@somewhere.com
From: me@overhere.com
Subject: A Message
Input1: posted value of input 1
Input2: posted value of input 2
Input3: posted value of input 3
Input4: posted value of input 4
Now, what I want to do is generate this email by dynamically looping through the form elements. I don't want to have to hardcode a request for each element. So my question is, is there someway I can index the form elements to control the order they get looped on? In other words, I need to control the order in which the form elements are caputered. Basically, I need the subject of the email to look like this:
Input4: posted value of input 4
Input2: posted value of input 2
Input3: posted value of input 3
Input1: posted value of input 1
I hope this question makes sense, I've tried to make it as clear as I can.
Thanks in advance to anyone who can help
Rich