Author |
Topic |
wii
Free ASP Hosts Moderator
Denmark
2632 Posts |
Posted - 24 February 2004 : 15:25:12
|
How do I modify the code, so I get a link instead of a button for logging out like this:
Logged in as: wii (logout) |
|
D3mon
Senior Member
United Kingdom
1685 Posts |
Posted - 24 February 2004 : 15:39:17
|
AFAIK, the only way to do this would be by using a javascript 'onclick' with a standard text <a> link, like:
<a href=""#"" onclick="formname.submit; return false;">Logout</a>
...but my Javascript is not the best!
|
Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod "In war, the victorious strategist only seeks battle after the victory has been won" |
|
|
wii
Free ASP Hosts Moderator
Denmark
2632 Posts |
Posted - 24 February 2004 : 15:47:33
|
Neither is mine, the form name must be frmLogout, so I have this:
<a href=""#"" onclick="frmLogout.submit; return false;">Logout</a>
Not enough though, because it doesn´t work, and what about the username ? |
|
|
D3mon
Senior Member
United Kingdom
1685 Posts |
|
D3mon
Senior Member
United Kingdom
1685 Posts |
Posted - 24 February 2004 : 15:55:47
|
quote: Originally posted by wii
Neither is mine, the form name must be frmLogout...
Unless its custom code you wrote yourself, I'd check that to make sure. Snitz has some kinda wired form names in places. |
Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod "In war, the victorious strategist only seeks battle after the victory has been won" |
|
|
wii
Free ASP Hosts Moderator
Denmark
2632 Posts |
Posted - 24 February 2004 : 15:59:06
|
Nope, took it from a standard inc_header.asp |
|
|
D3mon
Senior Member
United Kingdom
1685 Posts |
Posted - 24 February 2004 : 16:04:09
|
Need input from someone with a bit more Javascript knowledge [update] try brackets after the .submit part like ...submit();... |
Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod "In war, the victorious strategist only seeks battle after the victory has been won" |
Edited by - D3mon on 24 February 2004 16:06:17 |
|
|
D3mon
Senior Member
United Kingdom
1685 Posts |
|
wii
Free ASP Hosts Moderator
Denmark
2632 Posts |
Posted - 24 February 2004 : 16:11:22
|
Got it !!! The code looks like this, shows what you see at my first post:
Logged in as: <%= strDBNTusername %> <a href="javascript:document.frmLogout.submit();">(logout)</a>
Thanks D3mon |
|
|
D3mon
Senior Member
United Kingdom
1685 Posts |
|
tribaliztic
Senior Member
Sweden
1532 Posts |
Posted - 24 February 2004 : 16:40:15
|
I just made a link to "logout.asp" =) |
/Tribaliztic - www.gotlandrace.se -
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 24 February 2004 : 23:03:09
|
Leep in mind that if you ever need to perform an onSubmit in your form, this method of submitting a form with a link will not trigger it. I bring this up because I recently discovered this when I was using a validation script and using a url submit link. I ha to create a separate function to validate and submit when the link was clicked. I know this has nothing to do with Snitz, but just wanted to point this caveat out. |
|
|
|
wii
Free ASP Hosts Moderator
Denmark
2632 Posts |
Posted - 25 February 2004 : 01:37:02
|
thanks dayve, in this case, there are no problems, tested with lots of users now, even on macs and old netscape versions - no problems... |
|
|
ping
Starting Member
31 Posts |
Posted - 12 March 2004 : 14:27:01
|
Response.Write "<input src=""" & strImageUrl & "button_logout.gif"" type=""image"" border=""0"" value=""Logout"" id=""submit1"" name=""Logout"" tabindex=""-1"">" else Response.Write "<input type=""submit"" value=""Logout"" id=""submit1"" name=""submit1"" tabindex=""-1"">"
oh~select anyone(red) to like this :<a href="javascript:document.frmLogout.submit();">(logout)</a>???
|
|
|
tribaliztic
Senior Member
Sweden
1532 Posts |
|
wii
Free ASP Hosts Moderator
Denmark
2632 Posts |
Posted - 04 June 2004 : 02:40:47
|
I just use this:
Logged in as: <%= strDBNTusername %> <a href="javascript:document.frmLogout.submit();">(logout)</a>
Works fine ! |
|
|
Topic |
|