Salve a tutti.
Il mio problema:
dato un link, associo a questo una funzione che faccia comparire un certo valore in un "input text".
L'errore:
Non riesco a far comparire il valore da me indicato nei parametri della funzione richiamata nel link.
Volevo inoltre sapere se è possibile aggiungere un valore non solo ad <input type="text".. ma anche ad un campo nascosto.
Quello che ho fatto
(che contiene errori che non so individuare):
<html><head>
<script language="JavaScript" type="text/JavaScript">
<!--
function formato(x){
document.prev1.posname.value= document.prev1.posname.value + x
If (x='1') {
document.prev1.posvalue.value= document.prev1.posvalue.value + 'Full banner'
}
setfocus()
}
function calcprev(){
If (x=1) {
document.prev1.preventivo.value=1000
}
If (x=2) {
document.prev1.preventivo.value=986
}
If (x=3) {
document.prev1.preventivo.value=937
}
If (x=4) {
document.prev1.preventivo.value=690
}
If (x=5) {
document.prev1.preventivo.value=606
}
If (x=6) {
document.prev1.preventivo.value=479
}
If (x=7) {
document.prev1.preventivo.value=465
}
If (x=8) {
document.prev1.preventivo.value=338
}
}
//--!>
</script>
</head><body>
<form action="post" name="prev1" id="prev1" action="">
Seleziona la posizione in cui vuoi comparire.
[IMG1: pos1 pos2 .. ]
PosName
<input name="posname" id="posname" type="text" value="" />
PosValue
<input name="posvalue" id="posvalue" type="hidden" value="" />
</form>
</body></html>
Sapete essermi di aiuto?