garethtnash
asked on
Javascript - Auto Submit Form
I have a senario, where my client operates on many platforms, all that require their users to login and in most cases with different credentials for each platform.
I have suggested a master slave relationship, whereby the master site maintains a database that stores all other platform login details.
So upon logging into the master site, the user can easily login to any of the slave sites, without needing to enter additional login details.
The login details for each slave site would be stored in a database record.
However having looked at some of the existing platforms, they all use the "post" methods for the login form, so I was planning on therefor submittin g the form via javascript...
(I've tried the code below, but it doesn't work) Is this because the target (action) is on another domain / server, or is there something wrong with the javascript?
Many thanks
I have suggested a master slave relationship, whereby the master site maintains a database that stores all other platform login details.
So upon logging into the master site, the user can easily login to any of the slave sites, without needing to enter additional login details.
The login details for each slave site would be stored in a database record.
However having looked at some of the existing platforms, they all use the "post" methods for the login form, so I was planning on therefor submittin g the form via javascript...
(I've tried the code below, but it doesn't work) Is this because the target (action) is on another domain / server, or is there something wrong with the javascript?
Many thanks
<body onload="submitForm()">
<form method="post" action="http://www.slavedomain.co.uk/index.php" name="myForm" id="myForm">
<input type="hidden" name="username" value="candidate" />
<input type="hidden" name="passwd" value="candidate" />
</form>
<!-- now send the form! -->
<script type='text/javascript'>document.myForm.submit();</script>
</body>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you
ASKER