The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Help with 'Switch Characters' Widget

View previous topic View next topic Go down

Help with 'Switch Characters' Widget

Post by Dalekk7 on April 2nd 2013, 3:36 am

I recently installed on my site the widget where you can "Switch Characters" easily. This is the code:

Code:
<script type="text/javascript">
function switch_accounts() {
jQuery.get(document.getElementById('logout').href, function() {
jQuery.post('/login', 'login=1&username='+document.getElementById('switch_uname').value+'&password='+document.getElementById('switch_pass').value, function () {
window.location.reload();
});
});
}
</script>
<hr />
<center>
<input id="switch_uname" type="text" /><br />
<input id="switch_pass" type="password" /><br />
<input type="button" value="Switch Accounts" onclick="switch_accounts();" /></center>

It works it's not a problem on it not working, it's just that after you've entered your username and password and you click the "Enter" key on your keyboard, it doesn't work like that, you need to move your mouse to click "Switch Accounts" and I was wondering if there was a way to allow clicking "Enter" key could work.

Dalekk7
Forumember

Male Posts : 26
Reputation : 1
Language : English,Spanish,French,(Pig Latin)
Location : Miami, FL

http://hogwartsrestored.forumotion.com/

Back to top Go down

Re: Help with 'Switch Characters' Widget

Post by Dalekk7 on April 2nd 2013, 11:54 pm

bumpp

Dalekk7
Forumember

Male Posts : 26
Reputation : 1
Language : English,Spanish,French,(Pig Latin)
Location : Miami, FL

http://hogwartsrestored.forumotion.com/

Back to top Go down

Re: Help with 'Switch Characters' Widget

Post by SLGray on April 3rd 2013, 12:20 am

Please don't double/triple post. Your post need to be separated by 24 hours before bumping, replying or adding more information. Please use the edit button instead!


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36641
Reputation : 2441
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Re: Help with 'Switch Characters' Widget

Post by kirk on April 4th 2013, 6:13 pm

link to your form page where it is so i can see/try it?
Have you tried on any other browsers as well?

kirk
Forumaster

Male Posts : 11037
Reputation : 651
Language : English,Vulcan,Klingon, Romulan,& Gorn

Back to top Go down

Re: Help with 'Switch Characters' Widget

Post by Dalekk7 on April 16th 2013, 3:16 am

http://hogwartsrestored.forumotion.com/

on the left.

Also, it'd be cool if there was a way to like when you type the first letter, a box appears to "suggest" recently typed usernames to make it faster

Dalekk7
Forumember

Male Posts : 26
Reputation : 1
Language : English,Spanish,French,(Pig Latin)
Location : Miami, FL

http://hogwartsrestored.forumotion.com/

Back to top Go down

Re: Help with 'Switch Characters' Widget

Post by MissTiquelle on April 16th 2013, 3:29 pm

I don't know about the enter thing, but to get the usernames to be suggested change both appearances of 'switch_uname' to 'username' and that should do it.

Also, is this code freely available somewhere or is it something you wrote? Would love to be able to have something like this on our site.

MissTiquelle
New Member

Posts : 3
Reputation : 0
Language : English

Back to top Go down

Re: Help with 'Switch Characters' Widget

Post by Sir Chivas™ on April 16th 2013, 4:33 pm

Hi,

Try using this instead:
Code:
<script type="text/javascript">
function switch_accounts() {
jQuery.get(document.getElementById('logout').href, function() {
jQuery.post('/login', 'login=1&username='+document.getElementById('switch_uname').value+'&password='+document.getElementById('switch_pass').value, function () {
window.location.reload();
});
});
}
</script>
Switch Accounts<hr />
<input id="switch_uname" type="text" /><br />
<input id="switch_pass" type="password" /><br />
<input type="button" value="Switch Accounts" onclick="switch_accounts();" />



Attention!
- Please provide your forum URL at all times.
- When the issue is solved, please mark it as solved.



Sir Chivas™
Support Moderator
Support Moderator

Male Posts : 6783
Reputation : 430
Language : EN, FR, ES
Location : || CSS || HTML || Graphics Designs || Support ||

Back to top Go down

Re: Help with 'Switch Characters' Widget

Post by Dalekk7 on April 18th 2013, 5:59 am

Nope its still not working :l

Dalekk7
Forumember

Male Posts : 26
Reputation : 1
Language : English,Spanish,French,(Pig Latin)
Location : Miami, FL

http://hogwartsrestored.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum