You have to eventually submit the form, either by form.submit() or by using a submit button, to get the hidden values to php. a submit button is easy, or you could use the onsubmit= handler to call a function.
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
//********
//test.php
//********
<html>
<head><title>Test Page</title>
<script language="javascript">
function test_me()
{
document.myform.hidden1.value='value1';
document.myform.hidden2.value='value2';
document.myform.hidden3.value='value3';
}
</script>
</head>
<body>
<form method=post action=page3.php onsubmit="test_me();">
<input type=text name="fname">
<input type=text name="lname">
<?php
for ($count=1;$count<=3;$count++)
{
echo "<input type=hidden "name=hidden$count">
}
?>
<input type=submit name="submit" value="Submit Form">
</body>
</html>
[/code]
I just made that up, but hopefully it gives you some ideas. You can add if..then or while or whatever to the javascript function to do whatever you want to the form variable. say, maybe only make two hidden values if they don't give a first name...make 3 if they give both first and last, etc... it's up to whatever you are trying to do.
you can always change the submit button to something else, and then add the document.myform.submit() line to test_me(), like Shiju recommended.
---John Holmes...