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="JavaS cript">
function update() {
var ctrls_doc = document;
ctrls_doc.write ln("<html>");
ctrls_doc.write ln("<body>");
ctrls_doc.write ln("<form name='controls' >");
ctrls_doc.write ln("<table cellpadding='2' cellspacing='2'
border='1' height='100%'>" );
ctrls_doc.write ln("<td align='center' valign='center' >");
ctrls_doc.write ln("Inside FORM: <input type='text'
name='OpsName'> ");
ctrls_doc.write ln("</td>");
ctrls_doc.write ln("</tr>");
ctrls_doc.write ln("</table>");
ctrls_doc.write ln("</form><br>");
ctrls_doc.write ln("Outside FORM: <input type='text'
name='OpsName2' ><br><br>");
ctrls_doc.write ln("<input type='button' name='CheckMe'
value='Check ME' onclick='check( )'>");
ctrls_doc.write ln("</body>");
ctrls_doc.write ln("</html>");
ctrls_doc.close ();
}
function check()
{
alert("FIRST: " + window.document .controls.eleme nts.OpsName.val ue+
"\n" +
"SECOND: " + window.document .OpsName2);
}
update()
</script>
</html>
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="JavaS cript">
function update() {
var ctrls_doc = document;
ctrls_doc.write ln("<html>");
ctrls_doc.write ln("<body>");
ctrls_doc.write ln("<form name='controls' >");
ctrls_doc.write ln("<table cellpadding='2' cellspacing='2'
border='1' height='100%'>" );
ctrls_doc.write ln("<td align='center' valign='center' >");
ctrls_doc.write ln("Inside FORM: <input type='text'
name='OpsName'> ");
ctrls_doc.write ln("</td>");
ctrls_doc.write ln("</tr>");
ctrls_doc.write ln("</table>");
ctrls_doc.write ln("</form><br>");
ctrls_doc.write ln("Outside FORM: <input type='text'
name='OpsName2' ><br><br>");
ctrls_doc.write ln("<input type='button' name='CheckMe'
value='Check ME' onclick='check( )'>");
ctrls_doc.write ln("</body>");
ctrls_doc.write ln("</html>");
ctrls_doc.close ();
}
function check()
{
alert("FIRST: " + window.document .controls.eleme nts.OpsName.val ue+
"\n" +
"SECOND: " + window.document .OpsName2);
}
update()
</script>
</html>
Comment