Hello All
I have a script where i need to show the value of a text field in another textfield/field. I have done the same with my radio buttons and select fields like this:
[HTML]<script type="text/javascript">
function check(layers){
document.forms[0].answer.value=l ayers
}
function PrintValues(){
var myString = document.mainfo rm.file.value
var myStringLength = myString.length
var Comma = myString.lastIn dexOf(',')
var SufNumChars = Comma + 1
document.mainfo rm.result.value =('');
for(i=0; i<Comma; i++)
document.mainfo rm.result.value +=(myString.cha rAt(i));
document.mainfo rm.result.value +=(' ');
for(i=SufNumCha rs; i<myStringLengt h; i++)
document.mainfo rm.result.value +=(myString.cha rAt(i));
}
</script>
<div class="Accordio nPanelContent">
<input name="layers" value="2" type="radio" onclick="check( this.value)" /> 2<br />
<input name="layers" type="radio" onclick="check( this.value)" /> 4<br />
<input name="layers" type="radio" onclick="check( this.value)" value="6" /> 6<br />
<input name="layers" type="radio" onclick="check( this.value)" value="8" /> 8
</div>
<input type="text" name="answer" size="5" readonly="reado nly">
<div class="Accordio nPanelContent">
<select name="file" size="1" onchange="Print Values();" target="_parent ._top"
onmouseclick="t his.focus()">
<option value="DHL">Shi p with DHL</option>
<option value="UPS">Shi p with UPS</option>
</select>
<input name="result">
</div>
[/HTML]
But i can't seem to figure out how to do this with a textfield. Can anybody help me with this...???
Best regards
I have a script where i need to show the value of a text field in another textfield/field. I have done the same with my radio buttons and select fields like this:
[HTML]<script type="text/javascript">
function check(layers){
document.forms[0].answer.value=l ayers
}
function PrintValues(){
var myString = document.mainfo rm.file.value
var myStringLength = myString.length
var Comma = myString.lastIn dexOf(',')
var SufNumChars = Comma + 1
document.mainfo rm.result.value =('');
for(i=0; i<Comma; i++)
document.mainfo rm.result.value +=(myString.cha rAt(i));
document.mainfo rm.result.value +=(' ');
for(i=SufNumCha rs; i<myStringLengt h; i++)
document.mainfo rm.result.value +=(myString.cha rAt(i));
}
</script>
<div class="Accordio nPanelContent">
<input name="layers" value="2" type="radio" onclick="check( this.value)" /> 2<br />
<input name="layers" type="radio" onclick="check( this.value)" /> 4<br />
<input name="layers" type="radio" onclick="check( this.value)" value="6" /> 6<br />
<input name="layers" type="radio" onclick="check( this.value)" value="8" /> 8
</div>
<input type="text" name="answer" size="5" readonly="reado nly">
<div class="Accordio nPanelContent">
<select name="file" size="1" onchange="Print Values();" target="_parent ._top"
onmouseclick="t his.focus()">
<option value="DHL">Shi p with DHL</option>
<option value="UPS">Shi p with UPS</option>
</select>
<input name="result">
</div>
[/HTML]
But i can't seem to figure out how to do this with a textfield. Can anybody help me with this...???
Best regards
Comment