TechArena Community

TechArena Community (http://forums.techarena.in/)
-   Software Development (http://forums.techarena.in/software-development/)
-   -   Php form with javascript (http://forums.techarena.in/software-development/1276821.htm)

Solaris 30-11-2009 02:10 PM

Php form with javascript
 
Hi
I am trying to change some of my code on my web site to something more suitable, more suitable to my user needs. Curretnly the user submits the id by the popup which comes, instead I want it to be in the form of embedded text filed. Here is my code
Code:

<script language="javascript">

function raidlk() {
        raid_link = prompt('Enter Raid ID:',"");
        location = "5man.php?rlink="+raid_link;
}
</script>

This is the code where people click to get the popup submit box
Code:

<a href=javascript:raidlk()><font color="#00FF00">__Insert Raid ID__</font>
Now what I want is something like this
Code:

<form action="5man.php" method="post">
id: <input type="text" id=id name="name" />
<input type="submit" />
</form>

I just can find out how to replace this
Code:

<?=$_GET['rlink']?>
Any help or suggestion for this.

Reegan 30-11-2009 02:13 PM

Re: Php form with javascript
 
Hi
I think this is what you are looking for, just check it out if it works for you. any more help do post back and even if you have solved the problem then post back with a solved reply.
Code:

<form action="5man.php" method="get">
ID: <input type="text" name="rlink"><br>

<input type="submit">
</form>

Best of luck.

Solaris 30-11-2009 02:19 PM

Re: Php form with javascript
 
Hi
Thanks for your reply
I have inserted the form box where I want it, but it is still not working. When I enter the ID it dosnt submit as the id still remains in the textbook.
Code:

<?=$_GET['rlink']?>
The code above should get the ID entered in the submit box.

Reegan 30-11-2009 02:22 PM

Re: Php form with javascript
 
Hi
I am not sure if I have any more idea to it, still i will keep trying to solve it. Not sure but you can try this
Code:

<?php echo $_GET['rlink']; ?>
If you solve this then do post back.


All times are GMT +5.5. The time now is 04:57 AM.