ecnarongi
08-15-2002, 05:06 PM
I have two scripts below one I wrote sometime ago (bottom one) and one I wrote today (top one) and for some reason I can't see one wroks and one doesn't and they use the same routine. Can any one help me, thanks. All help is appreciated
----------------------------------------------------------------
This one dosen't work
----------------------------------------------------------------
<html>
<head>
<script language="javascript">
<!--
function switch()
{
document.hottie.bottie.value = document.op.bop.value
document.hottie.spottie.value = document.op.hop.value
}
-->
</script>
</head>
<body>
<form name="op">
<input type="text" name="bop"> <input type="text" name="hop">
</form>
<form name="hottie">
<input type="text" name="bottie"> <input type="text" name="spottie">
</form>
<form>
<input type="button" onclick="switch()" value="Switch Me">
</form>
</body>
</html>
---------------------------------------------------------------
This one works
---------------------------------------------------------------
<html>
<head><script language="javascript">
<!--
function chgVal()
{
document.form1.field2.value = document.form1.field1.value
}
-->
</script></head>
<body>
<form name="form1">
<input type="text" name="field1" size="18"><input type="button" value="Change" onClick="chgVal()">
<input type="text" name="field2" size="21">
</form>
</body>
</html>
----------------------------------------------------------------
This one dosen't work
----------------------------------------------------------------
<html>
<head>
<script language="javascript">
<!--
function switch()
{
document.hottie.bottie.value = document.op.bop.value
document.hottie.spottie.value = document.op.hop.value
}
-->
</script>
</head>
<body>
<form name="op">
<input type="text" name="bop"> <input type="text" name="hop">
</form>
<form name="hottie">
<input type="text" name="bottie"> <input type="text" name="spottie">
</form>
<form>
<input type="button" onclick="switch()" value="Switch Me">
</form>
</body>
</html>
---------------------------------------------------------------
This one works
---------------------------------------------------------------
<html>
<head><script language="javascript">
<!--
function chgVal()
{
document.form1.field2.value = document.form1.field1.value
}
-->
</script></head>
<body>
<form name="form1">
<input type="text" name="field1" size="18"><input type="button" value="Change" onClick="chgVal()">
<input type="text" name="field2" size="21">
</form>
</body>
</html>