Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6238879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:17:35+00:00 2026-05-24T11:17:35+00:00

I have a login form on our new website design, and it has a

  • 0

I have a login form on our new website design, and it has a username/password input, a drop-down select to choose which part of the site (control panels) to login to, and the submit button. As each panel has different needs to login from an external page, I wrote a Javascript function to match these. Unfortunately, it doesn’t seem to work, and I am lost on where the issue is.

<script type="text/javascript">
function changeAction(s)
{
    var loginform = document.getElementById("frmLogin");
    panel_option = parseInt(s.options[s.options.selectedIndex].value);

    switch (login_option)
    {
        case 0:
            loginform.action = "https://www.domain.com/clients/dologin.php?goto=clientarea";
            loginform.username.name = "username";
            loginform.password.name = "password";
            break;
        case 1:
            loginform.action = "http://my.domain.com/templates/default/login.aspx";
            loginform.username.name = "UserName";
            loginform.password.name = "Password";
            break;
        case 2:
            loginform.action = "http://voicepanel.domain.com";
            loginform.username.name = "email";
            loginform.password.name = "password";
            break;
        default:
            loginform.action = "https://www.domain.com/clients/dologin.php?goto=clientarea";
            loginform.username.name = "username";
            loginform.password.name = "password";
            break;
    }
}

function loginSubmit()
{
    var user = document.getElementsByName("username");
    var pass = document.getElementsByName("password");

    if(!user[0].value)
    {
        return;
    }

    if(!pass[0].value)
    {
        return;
    }

    document.getElementById("frmLogin").frmLogin.submit();
}
</script>

</head>
<body>
<div id="wrap">
<!--Start Header-->
<div id="header">
<a href="index.php" id="logo"><span class="text_in">XFS</span></a>

<!--User Login-->
<div id="header_right">
    <h2><span class="text_in">User Login</span></h2>

    <form method="POST" name="frmLogin" id="frmLogin" onSubmit="javascript:loginSubmit();">
        <input class="binput" name="username" style="margin-left: 40px;" value="Username">
        <input class="binput" name="password" type="password" value="Password">
            <select class="binput" style="margin-left: 40px; width: 130px;" onchange="javascript:changeAction(this);">
                <option value="0">Billing Panel</option>
                <option value="1">Game Panel</option>
                <option value="2">Ventrilo Panel</option>
            </select>
        <input type="submit" class="blogin" value="Login" id="ButtonLogin">
    </form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:17:35+00:00Added an answer on May 24, 2026 at 11:17 am

    Silly mistake, my switch statement in the Java script was on a non-existing variable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a login form that has Username and password as inputs from user
In our login page we enter username password and then submit the form. The
I have a login form for my website. This login form have two text
I have a usual login form consisting of two input fields, one for login,
I have a sign-in-action-form page which accept username and password from sign-in-form. Now most
I have a login form consisting of a Form with two TextInput's. I want
I have a login form which appears at the top of all of my
I have this login form. This form is a grouped table view where the
I have a login form, which needs to be re-directed to the main page
on my web site I want to have login/registration form in modal window done

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.