views:

184

answers:

2

I'm trying to make an auto login script and I'm stuck on the submit part...

The source of the submit form from the website is

<input type="submit" value="Sign In" class="signin" id="sumbitLogin">

and I'm trying

document.getElementById("sumbitLogin").submit();

if I set an Attribute, for example the value, it changes just fine...

How can I solve it?

+5  A: 

You don't submit an input field. You submit a form.

<form id="formid">
<input type="submit" value="Sign In" class="signin" id="sumbitLogin">
</form>

and ..

document.getElementById("formid").submit();
Lukman
thanx... changed the id for the form and it worked =)
Shady
A: 

Use form_name.submit()

<form id='myform' action='formmail.pl'>

Here is the code to submit a form when a hyperlink is clicked:

<form name="myform" action="handle-data.php">
Search: <input type='text' name='query' />
<a href="javascript: submitform()">Search</a>
</form>
<script type="text/javascript">
function submitform()
{
  document.myform.submit();
}
</script> 
pavun_cool