All pastes #449658 Raw Edit

Someone

public php v1 · immutable
·published 2007-04-20 11:03 UTC
rendered paste body
Is there a way to send a url parameter to a popup using a button in a form?This doesnt workIt pops up the popup window correctly but doesnt sent the $invNumber<form id="createInv" name="createInv" method="post" action="">Enter Auction Number<input name="invNumber" type="text" id="invNumber" size="25" /><?phpecho "<a target=\"popup\" onclick=\"wopen('specsheets/invoicecar.php?invNumber=". $_POST['invNumber'] ."', 'popup', 780, 699);";echo " return false;\" href=\"specsheets/invoicecar.php?invNumber=". $_POST['invNumber'] ."\">";echo "<input name=\"submitInvNo\" type=\"submit\" class=\"loginbutton\" id=\"submitInvNo\" value=\"Go\" /></a>\n";?></form>This sends the $invNumber but does not pop up a window<form id="createInv" name="createInv" method="post" action="specsheets/invoicecar.php">Enter Auction Number<input name="invNumber" type="text" id="invNumber" size="25" /><input name="submitInv" type="submit" class="loginbutton" id="submitInv" value="Go" /></form>Update:Initial form was requiring that the submit button was clicked twice in order for the popup to work and actually get the data, the click twice problem is still unresolved, but made it look pretty and like it was meant to be clicked twice.<?php$urlaction = "<a target=\"popup\" onclick=\"wopen('specsheets/invoicecar.php?invNumber=". $_GET['invNumber'] ."', 'popup', 780, 699);";$urlaction .= " return false;\" href=\"specsheets/invoicecar.php?invNumber=". $_GET['invNumber'] ."\">";if (isset($_GET['submitInv'])){	$damnError = array();	if (!empty($_GET['submitInv'])) 	{		if ($_GET['invNumber']=='')			$damnError['invNumber'] = 'An auction number is required to continue.';									if (count($damnError) == 0)		{			if (isset($_GET['submitInv']))			{				$urlaction = "<a target=\"popup\" onclick=\"wopen('specsheets/invoicecar.php?invNumber=". $_GET['invNumber'] ."', 'popup', 780, 699);";				$urlaction .= " return false;\" href=\"specsheets/invoicecar.php?invNumber=". $_GET['invNumber'] ."\">";			}		}	}}echo "<form id=\"createInv\" name=\"createInv\" method=\"get\" action=\"". $_SERVER['PHP_SELF'] ."\">\n";if (!empty($damnError['invNumber'])){	echo "<tr>\n";	echo "<td>Enter Auction Number<br>";	echo "<input name=\"invNumber\" type=\"text\" id=\"invNumber\" size='25' />";	echo "<input name=\"submitInv\" type=\"submit\" class=\"loginbutton\" id=\"submitInv\" value=\"Go\" /></td>\n";	echo "</tr>\n";	echo "<tr>\n";	echo "<td class=\"bdr3\">";	if (!empty($damnError['invNumber']))	{		echo "<span class=\"subtitle02\">". $damnError['invNumber'] ."</span>";	}	echo "</td>\n";	echo "</tr>\n";}elseif ((isset($_GET['submitInv'])) && (count($damnError) == 0)){	echo "<tr>\n";	echo "<td>Invoice Number entered, click Go.";	echo "<table width=\"100%\">\n";	echo "<tr>\n";	echo "<td class=\"bdr3\" width='150'>";	echo "<span class=\"titleorange01\">". $_GET['invNumber'] ."</span>&nbsp;&nbsp;&nbsp;</td>";	echo "<td>". stripslashes($urlaction) ."<input name=\"submitInv\" type=\"submit\" class=\"loginbutton\" id=\"submitInv\" value=\"Go\" /></a></td>\n";	echo "</tr>";	echo "</table></td>";	echo "</tr>\n";}else{	echo "<tr>\n";	echo "<td>Enter Auction Number<br>";	echo "<input name=\"invNumber\" type=\"text\" id=\"invNumber\" size='25' />";	echo "<input name=\"submitInv\" type=\"submit\" class=\"loginbutton\" id=\"submitInv\" value=\"Go\" /></td>\n";	echo "</tr>\n";}echo "</form>";?>