|
|
#1 (permalink) |
|
Registered User
Comfy Contributor
Joined in Jun 2006
106 posts
Gave thanks: 5
Thanked 1 Time in 1 Post
|
sending form variables to popup
Okay, no matter what i do, i can't get this to work.
search page: Code:
<form name="myform" id='myform' action="submit-form.php" method="post">
Search:
<input type='text' name='query'>
<a href="#" onclick="win=window.open('submit-form.php',null,'height=700,width=500,status=yes,toolbar=no,menubar=no,location=no'); this.form.target='myWin';this.form.action='http://google.com/search'">Submit Me</a>
</form>
submit-form.php: PHP Code:
it writes nothing. any suggestions? Thanks! -sheep |
|
|
|
|
|
#3 (permalink) |
|
Holy hell and a hippie
On a golden path...
Joined in Nov 2006
Lives in Canada
Hosted on SH106
392 posts
Gave thanks: 23
Thanked 25 times
|
Where are you initializing $query??
Try doing some debugging..: Code:
$query = $_POST['query'];
if ( isset($_POST['myform']) ) {
echo "Search: ".$query;
} else {
echo "Form didn't go through correctly!";
}
__________________
||http://eternal-realm.net ||http://usebbzone.com --------- Go There: Surpass Wiki ---------- || SH106 |
|
|
|
|
|
#5 (permalink) |
|
after g, before i
Resident.
Joined in Jul 2004
Lives in N,BC,CA
8,079 posts
Gave thanks: 48
Thanked 131 times
|
You're not submitting the form so the value isn't being sent. If you're wanting to use JavaScript to open a new window at a specific size, you'll have to grab the values and pass them as a query string.
|
|
|
|
|
|
#6 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Jan 2007
5 posts
Gave thanks: 0
Thanked 2 times
|
Just to give an example of how you *could* do this...
Code:
<form name="myform" id='myform' action="submit-form.php" method="post">
Search:
<input type='text' name='query' id='query'>
<a href="#" onclick="win=window.open('/somefile.php?query='+document.getElementById('query').value,null,'height=700,width=500,status=yes,toolbar=no,menubar=no,location=yes'); ">Submit Me</a>
</form>
Code:
print $_REQUEST['query']; |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|