ainoy31 Posted December 19, 2007 Share Posted December 19, 2007 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 Quote Link to comment Share on other sites More sharing options...
ainoy31 Posted December 19, 2007 Author Share Posted December 19, 2007 Figured out my issue. It was my javascript that was erasing the value of my variable. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.