Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Convert form to submit on load instead of clicking submit button?

Reply
Thread Tools

Convert form to submit on load instead of clicking submit button?

 
 
Network-Man
Guest
Posts: n/a
 
      06-04-2005
I am trying to streamline a form that in itself streamlines logging into a
site. Is there a way to make a form submit "onload" without clicking a
submit button?


<p><form
action="https://hostname.domain.com/ui/status/index.php?&DashBoardID=1&DashB
oard=Standard%20Services" method="post" target="_blank"><br />
<input type="hidden" name="LoginEmail" value="(E-Mail Removed)"><br />
<input type="hidden" name="LoginPassword" value="mycleartextpassword"><br />
<input type="submit" name="Authenticate" value="Login"><br />
<input type="hidden" name="Action" value="1" ><br />
</form></p>


Users want a a shortcut that when they open it it goes straight to the
destination page of their dashboard. It's *too much trouble* having to open
the page that has this form and click on the login button. Is there a way I
can pass the same information without using a form? Security isn't an issue.

TIA


 
Reply With Quote
 
 
 
 
Toby Inkster
Guest
Posts: n/a
 
      06-04-2005
Network-Man wrote:

> I am trying to streamline a form that in itself streamlines logging into a
> site. Is there a way to make a form submit "onload" without clicking a
> submit button?


<form id="foo">
....
</form>
<script type="text/javascript">
function myfunc () {
var frm = document.getElementById("foo");
frm.submit();
}
window.onload = myfunc;
</script>

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
 
 
 
Network-Man
Guest
Posts: n/a
 
      06-05-2005
Toby,
It worked like a charm.
I knew it would have something to do an "onload" statement, but that's as
close as I could get.
Thanks.

-Joel

"Toby Inkster" <(E-Mail Removed)> wrote in message
news(E-Mail Removed) .uk...
> Network-Man wrote:
>
> > I am trying to streamline a form that in itself streamlines logging into

a
> > site. Is there a way to make a form submit "onload" without clicking a
> > submit button?

>
> <form id="foo">
> ...
> </form>
> <script type="text/javascript">
> function myfunc () {
> var frm = document.getElementById("foo");
> frm.submit();
> }
> window.onload = myfunc;
> </script>
>
> --
> Toby A Inkster BSc (Hons) ARCS
> Contact Me ~ http://tobyinkster.co.uk/contact
>



 
Reply With Quote
 
terax terax is offline
Junior Member
Join Date: Apr 2008
Posts: 2
 
      04-07-2008
It redirects me to login page... only button works. Why?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<body onLoad="myfunc()">
<form action="http://cportal.webd.pl/login.php" method="post" target="_top" id="foo">
[...]
</body>
</form>
<script type="text/javascript">
function myfunc () {
var frm = document.getElementById("foo");
frm.submit();
}
</script>
 
Reply With Quote
 
terax terax is offline
Junior Member
Join Date: Apr 2008
Posts: 2
 
      04-07-2008
It redirects me to login page... only button works. Why?

<body onLoad="myfunc()">
<form action="http://cportal.webd.pl/login.php" method="post" target="_top" id="foo">

+

<script type="text/javascript">
function myfunc () {
var frm = document.getElementById("foo");
frm.submit();
}
</script>
 
Reply With Quote
 
gaul1 gaul1 is offline
Junior Member
Join Date: Jul 2012
Posts: 1
 
      07-07-2012
Hey Toby Inkster
Thanx a lot. You saved my day
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
submit 1 form to 2 servers or 2 forms to 2 server (1 form each) on 1 submit abansal.itp@gmail.com Javascript 3 06-23-2007 07:29 AM
hitting enter on a form instead of clicking the button Paul Furman HTML 4 03-17-2007 03:22 AM
javascript submit() function performs differently from clicking submit ljlolel Javascript 2 05-18-2006 04:35 PM
submit the form by clicking the button only. jrefactors@hotmail.com HTML 1 12-23-2004 06:50 PM
Submitting a form without clicking submit Fox ASP General 2 09-10-2003 05:51 PM



Advertisments