Ben,
You're likely to want something like this:
// IDs are taken from the elements' id attributes
var elUsername = document.getElementById('inpLoginUsername'), elForm =
document.getElementById('formLogin');
elUsername.textContent = "example"; // Replace with actual username
elForm.submit(); // Submits the form
See also https://developer.mozilla.org/en/DOM/form.submit,
https://developer.mozilla.org/en/DOM/document.getElementById.
On 2010-01-06 05:09, Ben Stover wrote:
Assume I go to a webpage with a form and a couple of entry fields.
Normally these entry fields are NOT pre-filled with values even not with Cookie
techniques
Is there a way to fill them (all) automatically with GM (and even simulate a
"submit")?
Lets assume the following example:
http://www.web.de/fm/
and I want to fill the field labelled "WEB.DE Nutzer" (which means loginname).
How would a GM script look like?
The form code of the web page looks like:
<form id="formLogin" action="https://login.web.de/intern/login/" name="fm"
method="post">
<fieldset>
<input type="hidden" value="freemail" name="service"/>
<input type="hidden" value="https://freemail.web.de" name="server"/>
<input type="hidden" value="https://freemail.web.de/msg/temporaer.htm"
name="onerror"/>
<input type="hidden" value="https://freemail.web.de/msg/logonfailed.htm"
name="onfail"/>
<legend>Login</legend>
<label for="inpLoginUsername">WEB.DE Nutzer</label>
<input id="inpLoginUsername" type="text" name="username"/>
<label for="inpLoginPasswd">Passwort</label>
<input id="inpLoginPasswd" type="password" name="password"/>
<input class="submit" type="submit" value="Login" name="rv_dologon"/>
</fieldset>
<ul id="loginLinks">
</ul>
</form>
Ben
--
cc | pseudonymous |<http://carlclark.mp/>
--
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/greasemonkey-users?hl=en.