Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 01-24-2009, 06:15 PM
VsUK VsUK is offline
Junior Member
 
Join Date: 11-25-08
Posts: 11
iTrader: 0 / 0%
Javascript help..

Ok, here is my problem i cant seem to figure out. I want to have a link with a missing section, for example.. worlduser.php?suid= &server=2

Now, i where theres a space between = & i want a javascript code so people click the link, enter there numeric value which would be unique to them & it puts there link just for there session in between = &.

So if i enter 12345 into the pop up java box asking for my user id & enter 12345. the link would be a valid link just for me until i close the webpage as worlduser.php?suid=12345&server=2


I played about with some javascript & it didnt work out so i hope someone can help me here.

Thanks
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 01-24-2009, 10:24 PM
cont911 cont911 is offline
Contributing Member
 
Join Date: 08-22-08
Posts: 58
iTrader: 0 / 0%
<html>
<script>
function checkLink()
{
var lnk = document.getElementById("link");
var href = lnk.href;

if((href.indexOf("suid= ") != -1) || (href.indexOf("suid=%20") != -1))
{
var id = prompt("enter unique id:");
lnk.href = "worlduser.php?suid=" + id +"&server=2";

}
}
</script>
<body>
<a id="link" onmousedown="checkLink()" href="worlduser.php?suid= &server=2" >Magic link</a>
</body>
</html>
 
Reply With Quote
  #3  
Old 01-25-2009, 07:51 AM
VsUK VsUK is offline
Junior Member
 
Join Date: 11-25-08
Posts: 11
iTrader: 0 / 0%
ok, that works for just the one link but what i want to do is a little more complex.

I want to have one link where you click to enter unique id.

then below will be links that are not complete, but i need ability to add more & work the same. So when i enter Accound ID into pop up box, it completes all the different links below it, which all missing the unique id which the user can input himself to complete the links.

sorry for not saying to start with.. didnt know how to best describe it Here is the exact Links n stuff..


http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char="unique id here"&add=texthare

Now each link will be different by Unique id & the end part texthere which will be a character name of that user. So they would be a list of links in a row with just the

Example here which dosnt work with what was given but you should get the picture

Code:
<html> <head> <title>Trustee list</title> <script> function checkLink() { var lnk = document.getElementById("link"); var href = lnk.href; if((href.indexOf("suid= ") != -1) || (href.indexOf("suid=%20") != -1)) { var id = prompt("Enter You Account ID:"); lnk.href = "http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char=" + id +"&add="; } </script> <body text="#FFFFFF" bgcolor="#000000" style="text-align: center" vlink="#1388CE"> <a id="link" onmousedown="checkLink()" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue1" >Trustee Now!</a> <a id="link" onmousedown="checkLink()" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue2" >Trustee Now!</a> <a id="link" onmousedown="checkLink()" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue3" >Trustee Now!</a> <a id="link" onmousedown="checkLink()" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue4" >Trustee Now!</a> <a id="link" onmousedown="checkLink()" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue5" >Trustee Now!</a> <a id="link" onmousedown="checkLink()" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue6" >Trustee Now!</a> <a id="link" onmousedown="checkLink()" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue7" >Trustee Now!</a> <a id="link" onmousedown="checkLink()" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue8" >Trustee Now!</a> <a id="link" onmousedown="checkLink()" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue9" >Trustee Now!</a> <a id="link" onmousedown="checkLink()" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue10" >Trustee Now!</a> </body> </html>
but i need to be able to add more links which all would work exactly the same. But the i need the Enter Account ID link to be on its own separate from the other links if you get me.

Last edited by VsUK; 01-25-2009 at 08:13 AM.
 
Reply With Quote
  #4  
Old 01-27-2009, 09:44 AM
cont911 cont911 is offline
Contributing Member
 
Join Date: 08-22-08
Posts: 58
iTrader: 0 / 0%
<html>
<head>
<title>Trustee list</title>
<script>
function checkLink(lnk)
{
var href = lnk.href;
if((href.indexOf("t_char= ") != -1) || (href.indexOf("t_char=%20") != -1))
{
var id = prompt("Enter Your Account ID:");
var links = document.getElementsByTagName("a");
for(i = 0; i < links.length; i++)
{
href = links[i].href;
href = href.replace("t_char= ", "t_char=" + id );
href = href.replace("t_char=%20", "t_char=" + id );
links[i].href = href;
}
}
}
</script>
<body text="#FFFFFF" bgcolor="#000000" style="text-align: center" vlink="#1388CE">
<a id="link" onmousedown="checkLink(this)" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue1" >Trustee Now!</a>
<a id="link" onmousedown="checkLink(this)" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue2" >Trustee Now!</a>
<a id="link" onmousedown="checkLink(this)" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue3" >Trustee Now!</a>
<a id="link" onmousedown="checkLink(this)" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue4" >Trustee Now!</a>
<a id="link" onmousedown="checkLink(this)" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue5" >Trustee Now!</a>
<a id="link" onmousedown="checkLink(this)" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue6" >Trustee Now!</a>
<a id="link" onmousedown="checkLink(this)" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue7" >Trustee Now!</a>
<a id="link" onmousedown="checkLink(this)" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue8" >Trustee Now!</a>
<a id="link" onmousedown="checkLink(this)" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue9" >Trustee Now!</a>
<a id="link" onmousedown="checkLink(this)" href="http://torax.outwar.com/myaccount_trust.php?t_serv=2&t_char= &add=blue10" >Trustee Now!</a>
</body>
</html>
 
Reply With Quote
  #5  
Old 01-27-2009, 10:38 AM
VsUK VsUK is offline
Junior Member
 
Join Date: 11-25-08
Posts: 11
iTrader: 0 / 0%
nice, works like a charm tyvm
 
Reply With Quote
  #6  
Old 01-29-2009, 06:59 AM
cont911 cont911 is offline
Contributing Member
 
Join Date: 08-22-08
Posts: 58
iTrader: 0 / 0%
welcome!
 
Reply With Quote
  #7  
Old 02-08-2009, 08:30 AM
VsUK VsUK is offline
Junior Member
 
Join Date: 11-25-08
Posts: 11
iTrader: 0 / 0%
Hi, ok smell bit of help i cant figure out. The code you helped me with con911 works great, however how do i make a link that dosnt activate & is just used for entering the ID? as at the moment i have to click the link & it pops up to enter id, but the links load before i enter the id & then i have to click the link again to get the correct address.

So, how do i add a part just for adding the ID to all links & then click the links where needed?
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
In javascript thenextbesthang Web Design Lobby 2 11-27-2006 11:51 AM
Count-up from a particular year + Javascript within Javascript? Help! Azam.net Coding Forum 3 06-06-2005 06:47 AM
Javascript ATLien Coding Forum 12 06-28-2004 09:36 AM
I need some help with JavaScript. Can anyone help me please? CrAg Coding Forum 2 03-22-2004 05:56 AM
javascript webmaster@lostinteardrops Coding Forum 16 10-31-2003 08:19 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 03:07 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC