Skip to content

Instantly share code, notes, and snippets.

@bennadel
Created March 24, 2014 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bennadel/9751096 to your computer and use it in GitHub Desktop.
Save bennadel/9751096 to your computer and use it in GitHub Desktop.
Hidden Input Ordering in FireFox Form Submission
function UpdateValueList( objRow ){
var objForm = document.forms[0];
var objValueList = objForm.elements["lst_id"];
var objTBody = objRow.parentNode;
var intI = null;
var objInput = null;
// Reset value list.
objValueList.value = "";
// Loop over TRs (by looping over TBodys child nodes).
for (intI = 0 ; intI < objTBody.childNodes.length ; intI++){
// Get the current row of the TBody.
objRow = objTBody.childNodes[ intI ];
// Check to make sure we have TR (not a text node);
if (objRow.nodeType == 1){
// Get the first input for the Row. Search for all INPUT elements within THIS TR.
objInput = objRow.getElementsByTagName("input")[0];
// Add that value back to the value list.
objValueList.value += ( objInput.value + ", " );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment