PHP Form with Javascript (MAYBE!!)

Discussion in 'PHP' started by VsUK, Nov 26, 2009.

  1. #1
    Im having difficulty changing some code on my website to something more suitable to my user needs. I currently use a popup form to submit the id & in staid i want to have a embedded textfield & submit box that does the same thing.

    Here is the bits of code i use.

    
    <script language="javascript">
    
    function raidlink() {
    	raid_link = prompt('Enter Raid ID:',"");
    	location = "5man.php?rlink="+raid_link;
    }
    </script>
    
    Code (markup):
    ====The link people click to get the popup submit box========
    
    		<a href=javascript:raidlink()><font color="#00FF00">__Insert Raid ID__</font>
    
    Code (markup):
    This is a example link that uses the submitted ID
    
    <a id="link" onmousedown="checkLink(this)" href="http://domain.com/joinraid.php?raidid=<?=$_GET['rlink']?>&suid=259144&serverid=2" style="text-decoration: none">
    
    Code (markup):
    Now id like a standard textfield & submit icon something like this..

    
    
    <form action="5man.php" method="post">
    
    id: <input type="text" id=id name="name" />
    
    <input type="submit" />
    </form>
    
    Code (markup):
    I just cant seem to figure out how to get what i enter to work with what i already use or find a way to get it work & replace
    
    <?=$_GET['rlink']?>
    
    Code (markup):
    if needed with something to do the same job.

    Id also like to use my own image for the submit button.

    Any help would be fantastic, i am a beginner at this & spend hours doing things that probably takes you 10 minutes lol.

    thanks
     
    VsUK, Nov 26, 2009 IP
  2. flakas123

    flakas123 Peon

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    <form action="5man.php" method="get">
    ID: <input type="text" name="rlink"><br>
    <input type="submit">
    </form>
    
    Code (markup):
    Is this what you want?
     
    flakas123, Nov 26, 2009 IP
  3. VsUK

    VsUK Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ill try that in a bit & let you know what effect it has, kids coming home from school so i better put the tea on :D ty for quick replay & ill get back laters & let you know how it went :D
     
    VsUK, Nov 26, 2009 IP
  4. VsUK

    VsUK Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Ok, i put the form box where i wanted it & tried but when i enter the ID it dosnt submit as the id still remains in the txtbox & it dosnt complete the links where
    <?=$_GET['rlink']?>
    Code (markup):
    Goes.

    the code above should get the ID entered in the submit box & complete the link in replace of the code when the link is clicked. This is the problem i have been having.
     
    VsUK, Nov 26, 2009 IP
  5. stOK

    stOK Active Member

    Messages:
    114
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #5
    Does this help ?
    
    <?php echo $_GET['rlink']; ?>
    
    PHP:
     
    stOK, Nov 26, 2009 IP
  6. VsUK

    VsUK Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    ive never used echo b4, where am i to put that?

    This is my pastebin of the main page
    vsuk.pastebin.com/m1ac0464d

    hopefully you will see what i mean & maybe do the changes for me :p
     
    Last edited: Nov 26, 2009
    VsUK, Nov 26, 2009 IP
  7. VsUK

    VsUK Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    anyone able to help?
     
    VsUK, Nov 29, 2009 IP