There's a site at work that I want to fill out with my name, email and phone number with either one click, or as soon as I navigate there.*
The site, in its most rudimentary form is this:
<html>
<body>
<table>
<TR>
<TD width="71"><BR><BR>Text1: </TD><TD colspan="5" width="608 <BR>**
Text2<BR>
<input name="Comment" size="100" maxlength="200" value="na">
</TD>
</TR>
<TR>
</table>
</body>
</html>
I've tried approaches based on these two questions on this site:
- How to fill in form field, and submit, using javascript?
- Using Javascript to Open a New Page and Populate Form Values There
But I just can't get anything to work. Here's the bookmarklet I have created:
javascript (function()%7Bdocument.getElementById("Comment").value%3D"Test111"%7D)()
but this gives an error of type "Uncaught TypeError: Cannot Set Property 'Value' of null"
I also created this bookmarklet:
javascript:(function()%7Bdocument.getElementByTagName("Comment")[0].value%3D"moo"%7D)()
which gives me an error of type "Uncaught TypeError: undefined is not a function"
I'm lost in the woods; I have experience coding but mostly data parsing and analysis in python or FORTRAN (eep). HTML and the various related scripting languages are really interesting to me, but I just don't understand them well enough to tackle this problem.
*If there's a way for me to submit a form of this type without actually navigating to the site, that would be great as well.