Jump to content

[SOLVED] Variable Pass to next Page?


ainoy31

Recommended Posts

Hello-

 

I need a second eye my code.  I have a drop menu and if someone selects "Other", then a new input text field pops up asking to type their value.  Here is the code to do so:

 

<td>Unit Type:</td>
		<td>
			<select name="pieces_type" onchange="toggleOther( document.form1.pieces_type.options[ document.form1.pieces_type.selectedIndex ].value );">
			<option value="">-Select One-</option>
			<option value="Pallets">Pallets</option>
			<option value="Packages">Packages</option>
			<option value="Totes">Totes</option>
			<option value="Other_Air">Other - Specify</option>
			</select>
			<input type="text" name="Other_Air" value="" size="25" maxlength="40" style="visibility:hidden" />
		</td>

 

I am passing this info to the next page.

 

$pt1 = $_POST["pieces_type"];

if($pt1 == 'Other_Air')
{
	$pt3 = $_POST["Other_Air"];
}
if($pt1 != 'Other_Air')
{
	$pt3 = $_POST["pieces_type"];	
}

echo "Type of Units: " . $pt3 . "<br>";

 

My issue is that if I select Other - Specify and enter my value, it does not get pass properly to the next page.  I get the value of Other_Air instead of what I entered say Crates.  I am probably overlooking something stupid but been up for 26 hrs now.  Much appreciation.  AM

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.