threep jumps up and down, crying "ooh! ooh! i can do this! back in a tick!"
and runs away, trying to find the webpage he did this for....
...and returns shortly after:
"ok, now, sending the email is up to your cgi setup etc...
so i'm not going to go there.
ok, wandering over to http://www.royalsunlife.com.au ....
oh, secure area. bugger. never mind.
ok, this is the important bit i have:
quote:
for(i=10;i<(itemNo+10);i++) {
if(thisForm.elements[i].value!="")
{
mail += thisForm.elements[i].name + ": "
mail += thisForm.elements[i].value
mail += "\n"
}
}
ok, now... for a bit of background, i had earlier: "thisForm = document.myForm" ; to save some time in writing, and i=10 because i wanted to start doing this exercise from the 10th element in the form.
itemNo is the number of items that i had to look at here, but this could normally be found dynamically with a varible like:
"(thisForm.elements.length - 1)" or maybe 2, if we realise that the submit button is a form element.
"mail" is that variable that i send to my cgi friend, what i have to do is write a new form with values like recient, mail and subject, and it does all that jazz for me.
for the form element:
<input type=text name="TPDEssProtec-YRT302" value="" size="3" maxlength="3" >
thisForm.elements[i].name is "TPDEssProtec-YRT302";
and thisForm.elements[i].value is whatever they have in the box.
naturally, this is when i equals whatever element this element is.
my only last bit of advice is that "\n" is new line, and "\t" is tab.
i'm not sure how much you already know, so i don't know what else i should've explained.
feel free to ask away.
if you want the form to look pretty, go investigate stylesheets: http://www.westciv.com/style_master/academy/hands_on_tutorial/index.html
hope this helps."
[This message has been edited by 3rdperson (edited 06-14-2001).]