alanl1 Posted June 18, 2013 Share Posted June 18, 2013 Hi all I have the following code block and on my second page I can pull the values with the second for loop foreach ($_POST[$data] as $datanumcolumns=>$datadownboxValue){ echo "Dropdown array value" .$datanumcolumns. " columns dropdown value " .$datadownboxValue. " "?><br /><br /><?php } foreach ($_POST['dropdown'] as $dropnumcolumns=>$dropdownboxValue){ echo "Dropdown array value" .$dropnumcolumns. " columns dropdown value " .$dropdownboxValue. " "?><br /><br /><?php } trouble is the dropdown box values are showing no problem but the textbox ones are not. could it be that $data variable or something. here is the part of my initial page code block <?php // Two counter variables necessary for looping purposes for dynmaic drop down box javascript client side functions $counter = 1; $counter1 = 1; if (($handle = fopen($filename, "r")) !== FALSE) { $length = 1000; $delimiter = ","; $rows = 0; // ADDED while ( ( $data = fgetcsv( $handle, $length, $delimiter ) ) !== FALSE ) { if( $rows == 0 ) { $num = count($data); for ($c=0; $c < $num; $c++) { echo "<table width=100% border=0>"; echo "<tr width=25% align=right><td>"; for ($d=0; $d < $num; $d++) { //echo "<option value='" .$data[$d]."'>" .$data[$d]."</option>"; } echo "<input type='text' id='".$data[$c]."' value='".$data[$c]."' DISABLED='disabled' style='background-color:White; color:Black;'>"; echo "</td>"; echo "<td width=20% align=left>"; ?> <---- Matches to -----> <select name="<?php echo "dropdown[" .$c."]" ?>" id="<?php echo "dropdown[" .$c."]" ?>" class="nohide" onchange="fillSelect(this,categories[this.value],'<?php echo "dropdown" .$counter++ ?>')"><?php echo "<option selected>Please Choose</option>"; echo "<option value='Manufacturer" .$c. "'>Software Manufacturer</option>"; echo "<option value='Product" .$c. "'>Product Name</option>"; echo "<option value='Version" .$c. "'>Product Version</option>"; echo "<option value='Keep Existing" .$c. "'>Keep Existing</option>"; echo "<option value='Ignore" .$c. "'>Ignore</option>"; ?></select><?php echo "</td>"; echo "<td width=15% align=left>"; ?> <select name="<?php echo "secondDD[" .$c ."]" ?>" id="<?php echo "secondDD[" .$c."]" ?>" style="display:none;" onchange="fillSelect(this,categories[this.value],'<?php echo "secondDD[" .$counter1++ ."]" ?>')"><?php echo "<option selected>Please Choose</option>"; echo "<option value='Manufacturer2" .$c. "'>Software Manufacturer</option>"; echo "<option value='Product2" .$c. "'>Product Name</option>"; echo "<option value='Version2" .$c. "'>Product Version</option>"; echo "<option value='Keep Existing2" .$c. "'>Keep Existing</option>"; echo "<option value='Ignore2" .$c. "'>Ignore</option>"; ?></select><?php echo "</td>"; echo "</tr>"; echo "</table>"; } } $rows++; // ADDED } fclose($handle); } Quote Link to comment Share on other sites More sharing options...
alanl1 Posted June 19, 2013 Author Share Posted June 19, 2013 apparently it is not possible when the text box is set to disabled so i have set this to read only. does anyone know if it is possible now thanks in advance Quote Link to comment Share on other sites More sharing options...
alanl1 Posted June 19, 2013 Author Share Posted June 19, 2013 Update FYI I have managed to do this, I changed to a readonly textbox <input type="text" name="<?php echo "textbox[" .$c ."]" ?>" id="<?php echo "textbox[" .$data[$c]."]" ?>" value="<?php echo $data[$c] ?>" readonly="readonly" style="background-color:White; color:Black;">thenforeach ($_POST['textbox'] as $datanumcolumns=>$datadownboxValue){ echo "Textbox value" .$datanumcolumns. " has a value of " .$datadownboxValue. " "?><br /><?php } Quote Link to comment Share on other sites More sharing options...
Solution DavidAM Posted June 20, 2013 Solution Share Posted June 20, 2013 apparently it is not possible when the text box is set to disabled so i have set this to read only. does anyone know if it is possible now thanks in advance This is a true statement. Disabled form elements are not posted with the form. Read Only elements are posted. Keep in mind, however, that it is very simple for a visitor to change the value if they try -- the same is true for hidden elements which are posted. 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.