Watch Naruto Online - Windsurfing Video - Debt Consolidation - Free Anonymous Surfing - Property in Germany

PDA

View Full Version : Pulling form variables without knowing their names


lyleyboy
Aug 15th 2007, 12:35 am
Hi,

I know this is possible in PHP but is there a way to pull the variables submitted from a form without knowing their names.
I have a site that the users can change the forms and I need to process them.

Wildhoney
Aug 15th 2007, 3:40 am
pContainer = document.getElementById('theFormContainer');

if(!pContainer.hasChildNodes())
{
// No child nodes
return false;
}

for(iIndex = 0; iIndex < pContainer.childNodes.length; iIndex++)
{
// Loop through all the form's child nodes and get their node name
alert('This form element is "' + pContainer[iIndex].nodeName + '" with a value of "' + pContainer[iIndex].getAttribute('value') + '"');
}