Making a Web Page Text Field Accessible to JavaScript
-
Consider the HTML source for the SMILES input text field
in the CLOGP web page:
<FORM NAME="smilesForm"
METHOD=POST
ACTION="/daycgi/clogpeditorsubmit">
<SELECT NAME="inputTypeSelector" SELECTED>
<OPTION>SMILES
<OPTION>Invoke CGI-Grins
</SELECT>
<INPUT NAME="smiles" SIZE=30 VALUE="'"${SMI}" '">
<INPUT TYPE=SUBMIT NAME="Submit" VALUE="submit">
</FORM>'
-
Each Form element has a NAME attribute. The name can be anything
you want.
-
Given this naming scheme, JavaScript would access the SMILES
input field as
-
This name has to be used in the JavaScript function that
invokes JavaGrins