Created
March 24, 2014 22:54
-
-
Save bennadel/9751096 to your computer and use it in GitHub Desktop.
Hidden Input Ordering in FireFox Form Submission
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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