Ecco quanto ho realizzato ad ora:
codice:
<script type="text/javascript">
function aggiornaHidden(sel){
var f = document.smsArubaForm;
f.sel_value.value = sel.options[sel.selectedIndex].value;
f.sel_title.value = sel.options[sel.selectedIndex].title;
}
</script>
codice:
<form method="post">
<select onchange="aggiornaHidden(this)">
<option value="" selected> Scegli </option>
<option title="333" value="3671226" >Marco</option>
<option title="347" value="6015293" >Matteo</option>
</select>
<input type="text" name="sel_title">
<input type="text" name="sel_value">
</form>
I due input (che poi andrò a nascondere) vengono aggiornati correttamente, ma io dovrei cambiarne il valore, mentre il name resta fissato, ovvero:
codice:
<input type="text" name="prefisso" name="sel_title" >
<input type="text" name="smsdestinatario" value="sel_value">
Come fare? :master:
Help!