The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Login box in navbar !

3 posters

Go down

Login box in navbar ! Empty Login box in navbar !

Post by SASAN. 19th April 2012, 23:49

Hi, Does anyone know how to do this?

[img]Login box in navbar ! Di-JNF0[/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.
SASAN.
New Member

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

http://gamefactor.forumz.ro/forum

Back to top Go down

Login box in navbar ! Empty Re: Login box in navbar !

Post by LGforum 20th April 2012, 23:47

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
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

Login box in navbar ! Empty Re: Login box in navbar !

Post by SASAN. 21st April 2012, 21:09

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

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

http://gamefactor.forumz.ro/forum

Back to top Go down

Login box in navbar ! Empty Re: Login box in navbar !

Post by LGforum 22nd April 2012, 04:55

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
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

Login box in navbar ! Empty Re: Login box in navbar !

Post by moeztro4 22nd April 2012, 05:06

the manuscript was placed in CSS Or Not
avatar
moeztro4
New Member

Posts : 17
Reputation : 1
Language : indonesia

Back to top Go down

Login box in navbar ! Empty Re: Login box in navbar !

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

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

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

http://gamefactor.forumz.ro/forum

Back to top Go down

Login box in navbar ! Empty Re: Login box in navbar !

Post by LGforum 22nd April 2012, 16:06

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
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

Login box in navbar ! Empty Re: Login box in navbar !

Post by SASAN. 22nd April 2012, 16:19

Thanks a lot, to add a picture? such that:
Login box in navbar ! Di-BAXJ

and butonu move to the right?
SASAN.
SASAN.
New Member

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

http://gamefactor.forumz.ro/forum

Back to top Go down

Back to top

- Similar topics

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