Is there a way have 2 textboxes on the same form where the value of the
first textbox is always the value of the 2nd textbox (even onload)?
Quickhack:
<head>
...
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript">
function syncInputs(f, name1, name2)
{
var es;
if (f && (es = f.elements)
&& es[name1]
&& es[name2]
&& typeof es[name2].value != "undefined")
{
es[name2].value = es[name1].value;
}
}
</script>
</head>
<body onload="syncInputs(document.forms['form1'], 'text1', 'text2');">
...
<form ... name="form1">
<input name="text1" value="foo"
onchange="syncInputs(this.form, this.name, 'text2');">
<input name="text2">
</form>
...
</body>
PointedEars