Forum Moderators: coopster
i have a simple text field and i would like to sumbit this value to a new window and add it to a database
problem is how to i click that image button to open a new window? i have tryed this
<INPUT TYPE="image" src="images/search_button.gif" onClick="window.open('search2.php?id=$idshow','mywindow','width=560,height=400')" name="submit">
but this does not work can any one help please.
<INPUT TYPE="image" src="images/search_button.gif" onClick="window.open('search2.php?id=<?=$idshow?>','mywindow','width=560,height=400')" name="submit">
If that doesn't work, change the highlighted portion above to:
<?php print($idshow);?>
Regards
ok it opens the new window but does not pass the varible over correctly.
code is
<INPUT TYPE="image" src="images/signup.gif" onClick="window.open('newsletter.php','mywindow','width=400,height=400')" name="submit">
and there is a textfield named email on this page also
i want this field carried over to new open window but it does not work any sugggestions please?
then on your newsletter.php page check for the variable $_REQUEST['id'];
if you want to pass several variables then your going to need to submit the form first or things could get messy.
Hope that helps,
hughie
[edited by: hughie at 2:53 pm (utc) on Dec. 29, 2004]
Let's step back for a moment. You want to submit a form to a new window, right? It may be better to use the form tag to do this:
<form method="post" action="search2.php" target="_blank" onsubmit="window.open('', 'processor_window', 'width=560,height=400'); this.target = 'processor_window'">
You should be able to access all the form elements' values using the $_POST['element_name'] method.