Portal Home > Knowledgebase > Articles Database > jQuery Help


jQuery Help




Posted by SBTE, 08-10-2009, 02:46 PM
I've never used jquery before and I have been working on this for the past 2 hours. I have a login system on my front webpage to login 2 control panels. Control panel 1 and control panel 2. I have the html form's already to login, I just don't want to put 2 login forms right next to each other. I want to be able to use 2 radio buttons. So my login would look like this: Username: _____ Password: _____ *Control Panel 1 *Control Panel 2 (Login) So basically the radio buttons would just refresh that small part of the page without leaving the page and change the form to whichever control panel they choose to login with.

Posted by olddocks, 08-10-2009, 03:36 PM
check this out: http://corpocrat.com/2009/07/15/quic...l-with-jquery/ That is the simplest i have seen!

Posted by SBTE, 08-10-2009, 04:20 PM
I'm not looking for a registration form and it doesn't look familiar to what im looking for.

Posted by DesignBear, 08-10-2009, 04:32 PM
The form wont look like what you want because you'll need to style it with CSS to meet your needs

Posted by SBTE, 08-10-2009, 06:20 PM
I already have the forms coded. All I need is the script and instructions on how to switch between 2 forms without leaving the page.

Posted by okhud, 08-10-2009, 10:06 PM
For the above code to work, you need to change "login_form" with the name of the login form, and make sure you don't have any other radio buttons in the form (if you do, the above function will act weird, but theres a work around). Also, change the "Value" attribute of your radio buttons to the control panel login page (the one you post the username/password to). Below is a full HTML that works. Last edited by okhud; 08-10-2009 at 10:14 PM.

Posted by SBTE, 08-10-2009, 10:35 PM
Thanks, it worked but I have one problem. When I click on either one of the buttons, the previous button stays filled in still. The script still works though, it will go to whatever panel the last button is clicked.

Posted by okhud, 08-10-2009, 10:41 PM
Make sure the "name" attribute is the same for both radio buttons:



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
apache + spawn-fcgi (Views: 508)