Hi,
I am trying to query the value of a textfield outside of a form but
with no success so far... the reason why I am not using a form is that
there seams to be an annoying issue with hitting the [Enter] key (at
least in Mozilla) when there is only one textfield in the form... the
[Enter] key seams to trigger some type of a submit... but when the
textfield is defined outside of a form this is not an issue... However
I don't know how to access the value for the textfield outside the
form... see example below...
any help is greatly appreciated...
Thanks,
Markus.
<html>
<script language="JavaScript">
function update() {
var ctrls_doc = document;
ctrls_doc.writeln("<html>");
ctrls_doc.writeln("<body>");
ctrls_doc.writeln("<form name='controls' >");
ctrls_doc.writeln("<table cellpadding='2' cellspacing='2'
border='1' height='100%'>");
ctrls_doc.writeln("<td align='center' valign='center'>");
ctrls_doc.writeln("Inside FORM: <input type='text'
name='OpsName'>");
ctrls_doc.writeln("</td>");
ctrls_doc.writeln("</tr>");
ctrls_doc.writeln("</table>");
ctrls_doc.writeln("</form><br>");
ctrls_doc.writeln("Outside FORM: <input type='text'
name='OpsName2'><br><br>");
ctrls_doc.writeln("<input type='button' name='CheckMe'
value='Check ME' onclick='check()'>");
ctrls_doc.writeln("</body>");
ctrls_doc.writeln("</html>");
ctrls_doc.close();
}
function check()
{
alert("FIRST: " + window.document.controls.elements.OpsName.value+
"\n" +
"SECOND: " + window.document.OpsName2);
}
update()
</script>
</html>