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.

Login box in navbar !

View previous topic View next topic Go down

Login box in navbar !

Post by SASAN. on April 19th 2012, 11:49 pm

Hi, Does anyone know how to do this?

[img][/img]

I do not know English very well, so do not jump on my mouth...

So I got this java code:

Code:
$(document).ready(function(){
 var existLog = $('#logout').length;

  if(existLog === 0) {
    $('.headerbar').append('<form id="ddlogin" action="/login.forum" method="post">
  <fieldset>
    <dl>
    <dd><input type="text" tabindex="1" name="username"
id="username" size="20" maxlength="40" value="Nume de utilizator" class="inputbox"
/></dd>
    </dl>
    <dl>
     
 
    <dd><input type="password" tabindex="2" id="password"
name="password" value="Parola" size="20" maxlength="25" class="inputbox"
/></dd>
    </dl>
    <dl>
     
<dd><label for="autologin"><input type="checkbox"
name="autologin" id="autologin" tabindex="4" class="checkbox"
checked="checked" /> Remember me</label></dd>
    </dl>
    <dl>
      <dd><input type="submit" name="login" tabindex="6" value="Conectare" class="button2" /></dd>
    </dl>
  </fieldset>
</form>');
  }
});

When I connect to me, I remain a button that says disconnect, please help me!

SASAN.
New Member

Male Posts : 17
Reputation : 1
Language : Romania
Location : Bucharest

http://gamefactor.forumz.ro/forum

Back to top Go down

Re: Login box in navbar !

Post by LGforum on April 20th 2012, 11:47 pm

There is a big error in the script... the fact that you have all those line breaks... the HTML has to be all on one line.

If you have removed the default forumotion navbar, then it will not work.

Anyway, here's a cleaned up script:
Code:

$(function(){
  if(!document.getElementById('logout')) {
    $('.headerbar').append('<form id="ddlogin" action="/login.forum" method="post"><fieldset><dl><dd><input type="text" tabindex="1" name="username" id="username" size="20" maxlength="40" value="Nume de utilizator" class="inputbox" /></dd></dl> <dl><dd><input type="password" tabindex="2" id="password" name="password" value="Parola" size="20" maxlength="25" class="inputbox"/></dd></dl><dl><dd><label for="autologin"><input type="checkbox" name="autologin" id="autologin" tabindex="4" class="checkbox" checked="checked" />Remember me</label></dd></dl><dl><dd><input type="submit" name="login" tabindex="6" value="Conectare" class="button2" /></dd></dl></fieldset></form>');
  }
});

LGforum
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Re: Login box in navbar !

Post by SASAN. on April 21st 2012, 9:09 pm

Thanks for the help, but I want to stay after I connect the forum button in navbar with Disconnect

SASAN.
New Member

Male Posts : 17
Reputation : 1
Language : Romania
Location : Bucharest

http://gamefactor.forumz.ro/forum

Back to top Go down

Re: Login box in navbar !

Post by LGforum on April 22nd 2012, 4:55 am

Well you need to add in the necessary code ...

Add an ELSE statement and do the same thing but instead the HTML for logout.
If you wrote that much I'm sure you know...

Unless you didn't write it...

LGforum
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Re: Login box in navbar !

Post by moeztro4 on April 22nd 2012, 5:06 am

the manuscript was placed in CSS Or Not

moeztro4
New Member

Posts : 17
Reputation : 1
Language : indonesia

Back to top Go down

Re: Login box in navbar !

Post by SASAN. on April 22nd 2012, 12:52 pm

Honestly I'm not good at Java, css, html ... If you know what I want and can help me and me

SASAN.
New Member

Male Posts : 17
Reputation : 1
Language : Romania
Location : Bucharest

http://gamefactor.forumz.ro/forum

Back to top Go down

Re: Login box in navbar !

Post by LGforum on April 22nd 2012, 4:06 pm

Code:

$(function(){
  if(!document.getElementById('logout')) {
    $('.headerbar').append('<form id="ddlogin" action="/login.forum" method="post"><fieldset><dl><dd><input type="text" tabindex="1" name="username" id="username" size="20" maxlength="40" value="Nume de utilizator" class="inputbox" /></dd></dl> <dl><dd><input type="password" tabindex="2" id="password" name="password" value="Parola" size="20" maxlength="25" class="inputbox"/></dd></dl><dl><dd><label for="autologin"><input type="checkbox" name="autologin" id="autologin" tabindex="4" class="checkbox" checked="checked" />Remember me</label></dd></dl><dl><dd><input type="submit" name="login" tabindex="6" value="Conectare" class="button2" /></dd></dl></fieldset></form>');
  }
  else {
  $('.headerbar').append('<a href="/logout?logout=1"><div style="border:1px solid;color:#c05;background:#e1ebf2;padding:3px 5px;">Log Out</div></a>');

  }
});

LGforum
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Re: Login box in navbar !

Post by SASAN. on April 22nd 2012, 4:19 pm

Thanks a lot, to add a picture? such that:


and butonu move to the right?

SASAN.
New Member

Male Posts : 17
Reputation : 1
Language : Romania
Location : Bucharest

http://gamefactor.forumz.ro/forum

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