On Wed, 07 Mar 2007 11:00:16 +0100, <pr***********@ gmail.comwrote:
>
function submitPartsForm (str) {
var count=document. getElementsByNa me("partId");
for(var i=0;i<count.len gth;i++)
{
document.mylist .myNum[i].value= document.getEle mentsByName("pa rtNum")
(i).value;
}
document.forms["mylist"].submit();
}
myNum[] is a hidden variable and partNum is the name of a text field
that has many instances i mean there are many textfields with the same
name so it forms a column in a data table.
One way would be to join the text values together using a join character
unlikely to appear in the texts, like so:
function submitPartsForm () {
var theNodeList = document.getEle mentsByName("pa rtId");
var theNodeValues = document.forms["myList"].elements["theNodeVal ues"];
if(theNodeList& &theNodeValu es) {
for (var i=0;i<theNodeLi st.length;i++) {
if (theNodeList[i].value) {
theNodeValues.v alue += ("|" + theNodeList[i].value.toString ());
}
}
document.forms["myList"].submit();
}
}
(Above script assumes the form has a hidden input (not disabled), named
"theNodeValues" .)
Then in your server-side script you can use whatever method your language
uses to split the string into parts using the "|" as a split character.
Usually this results in an array.
--
Using Opera's revolutionary e-mail client:
http://www.opera.com/mail/