mercredi 22 juin 2016

Auto-filling text fields using HTML and Javascript

I am trying to create a bookmark that will auto fill a text field of a webpage. However; I'm receiving the following error code:

(program):1 Uncaught TypeError: Cannot set property 'text' of null

The code below is the element of the text field

<input type="text" name="test_IN" size="6" maxlength="5" id="text_id1">

The following is the bookmark code that I created:

<!DOCTYPE NETSCAPE-Bookmark-file-1>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html/javascript; charset=UTF-8">
<TITLE>Test</TITLE>
<DL><p>
    <DL><p>
       <DT><A  HREF="javascript:document.getElementById('text_id1').value='123';">test</A>
    </DL><p>
</DL><p>

I am also trying to do this in Google Chrome.




Aucun commentaire:

Enregistrer un commentaire