Results 1 to 4 of 4

Thread: [JAVASCRIPT] Submit function

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    Newcastle,UK
    Posts
    66

    [JAVASCRIPT] Submit function

    Hi

    Can anyone help with a puzzling problem:

    I have a form and the form has an action, to an external url and a method of post. This form is used to log into a website that is not ours.

    If i put a button into the form labelled sumbit then the user is logged into this new form.

    However if i use the following code then we are redirected to the page but not logged in.

    <a onclick="javascript: Login();">Click here to login</a>

    <script>
    function Login()
    {
    theplusForm = document.forms['plusLogin'];

    theplusForm.submit();
    }
    </script>
    Anyone have any ideas?

    Sarah

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    Is plusLogin the name of the form?
    what happens if you go
    Code:
    document.plsLogin.submit();
    or is there more than one form on the page?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    Newcastle,UK
    Posts
    66
    plusLogin is the name of the form.

    Unfortunately this code does not work either

    Sarah

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Two suggestions:

    Try this:
    Code:
    <a href="#" onclick="java script: Login();">Click here to login</a>
    And the other suggestion would be to use a submit button that has the action equal to the full URL of the page that it's to be submitted to.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width