Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q711 How do I tell if a field exists on a form?

You are here: irt.org | FAQ | JavaScript | Form | 3.1 | Q711 [ previous next ]

Try:

<FORM NAME="myform">
<INPUT TYPE="TEXT" NAME="myfield">
</FORM>

<SCRIPT LANGUAGE="JavaScript"><!--
if (document.myform.myfield)
    alert('myfield exists');
else
    alert('myfield does not exist');
if (document.myform.myotherfield)
    alert('myotherfield exists');
else
    alert('myotherfield does not exist');
//--></SCRIPT>

Feedback on 'Q711 How do I tell if a field exists on a form?'

©2018 Martin Webb