Mi sa che però mi sono spiegato male io. Non riesco a far arrivare niente alla pagina php proprio. Dal form hidden non passa nulla alla pagina php. Ti incollo qui la pagina html e js.
<script language=javascript>
scriptAr = new Array();
scriptAr[0] = "one";
scriptAr[1] = "two";
scriptAr[2] = "three";
//alert(scriptAr.toString());
</script>
<?
//Step 2:
//Now we will create a hidden form field as follows
?>
<form action="phpArrayTest.php" method=post name=test onSubmit="setValue()">
<input name="arv" type=hidden>
<input type="submit">
</form>
<?
//Here what we have done is, when the submit is called we first do some work ("onSubmit=setValue()") by using the onSubmit method.
//The onSubmit method will invoke setValue() function defined by us. After that the action will take place and stringTokens.php will be called.
//Step 3:
//Here we define the setValue method. The method will convert the array periviously defined in to a string and then set it to the hidden field.
?>
<script language=javascript>
function setValue()
{
var arv = scriptAr.toString();
// This line converts js array to String document.test.arv.value=arv;
// This sets the string to the hidden form field. }
</script>
Dove sbaglio? come faccio a far passare quel vettore al php?
Ancora grazie.