Ho trovato questo script che estrae il value di un campo "file".
Come si può modificare per far si che il risultato invece di apparire come "alert" venga messo al posto del value dell'input hidden del secondo form?
Ecco lo script:


<script language="JavaScript"><!--
function extract(what) {
if (what.indexOf('/') > -1)
answer = what.substring(what.lastIndexOf('/')+1,what.length);
else
answer = what.substring(what.lastIndexOf('\\')+1,what.lengt h);
alert(answer);
}
//--></script>

<form name="myform">
<input type="file" name="myfile">
<input type="button" value="Test" onClick="extract(this.form.myfile.value)">
</form>