I have a form which is populated via a server side php
file and this echo's all the fields and data from the records in MYSQL
echo '<li class="form-line" id="id_21"><label class="form-label-left" id="label_21" for="input_21"> Customer Job Details </label><div id="cid_21" class="form-input">';
echo '<table>';
echo '<tr>';
echo '<td><label class="form-sub-label" for="first_3" id="sublabel_first"> Customers Name </label><input type="text" id="CustomerName" value="' . $rows['CustomerName'] . '"></td>';
echo '<td><label class="form-sub-label" for="first_3" id="sublabel_first"> Signing Date </label><input type="text" id="SignDate" value="' . $rows['SignDate'] . '"></td>';
echo '<td><label class="form-sub-label" for="first_3" id="sublabel_first"> OrderNumber </label><input type="text" name="OrderNumber" id="OrderNumber" value="' . $rows['OrderNumber'] . '"></td>';
echo '</tr>';
echo '<tr>';
echo '<td><label class="form-sub-label" for="first_3" id="sublabel_first"> Current Account Status </label><input type="text" id="CustomerStatus" value="' . $rows['CustomerStatus'] . '"></td>';
echo '<td><label class="form-sub-label" for="first_3" id="sublabel_first"> Customer Last Updated </label><input type="text" class=" form-textbox" data-type="input-textbox" id="input_21" name="CustomerLastUpdate" size="20" value="' . $rows['LastUpdated'] . '" /></td>';
echo '<td><label class="form-sub-label" for="first_3" id="sublabel_first"> Contact Email </label><input type="text" id="OrderNumber" name="Email" size="25" value="' . $rows['Email'] . '"></td>';
echo '</tr>';
echo '</table>';
echo '<li class="form-line" id="id_4"><label class="form-label-left" id="label_4" for="input_4"> Company Name </label><div id="cid_4" class="form-input">';
echo '<label class="form-sub-label" for="first_3" id="sublabel_first"> Company Name </label><input type="text" class=" form-textbox" data-type="input-textbox" id="input_4" name="q4_companyName4" size="40" value="' . $rows['CompanyName'] . '" />';
echo '</div>';
echo '</li>';
echo '<li class="form-line" id="id_5">
<label class="form-label-left" id="label_5" for="input_5"> Address </label>
I have built a small test file to update in .....Update.html
<html>
<form method="post" name="update" action="Update.php" />
Address1:
<input type="text" name="Address1" />
OrderNumber:
<input type="text" name="OrderNumber" />
<input type="submit" name="Submit" value="update" />
</form>
Also have a server-side file called Update.php
or die("Could not select examples");
$Add1 = $_POST["q5_address5[addr_line1]"];
$Add2 = $_POST["Address1"];
$Order = $_POST['OrderNumber'];
$query = "UPDATE CurrentJobs SET StreetAddress = '$Add1' WHERE OrderNumber = '$Order'";
if(mysql_query($query)){
echo "updated '$Add1''$Add2' Value";}
else{
echo "fail";}
?>
These 2 test file are working well on my database, and it seems that, because I echo
ing the data from my server side file I am not getting the update as correct. echo
ing the $Add1
value and it is empty also it clears any data I place in the field manually so it seems to be returning ""
Any suggestion what I am doing wrong would be appreciated.
i ahve placed a POST method in the html form
<form class="xxxxxx" action="Update.php" method="post" name="update" id="UpdateFrorm" accept-charset="utf-8">
<button id="input_2" type="submit" class="form-submit-button form-submit-button-metal_brushed">
Submit
</button>
i have also tried to place the update button in the php file but still no joy...
echo '<div style="text-align:center" class="form-buttons-wrapper">
<form class="xxxxxxx" action="Update.php" method="post" name="update" id="UpdateFrorm" accept-charset="utf-8">
<button id="input_2" type="submit" class="form-submit-button form-submit-button-metal_brushed">
Submit
</button>
<button id="input_print_2" style="margin-left:25px;" class="form-submit-print form-submit-button-metal_brushed" type="button">
<img src="http://cdn.jotfor.ms/images/printer.png" align="absmiddle" />
Print Form
</button>
<INPUT TYPE="Submit" VALUE="Update the Record" NAME="Submit">
</div>';
You are not posting q5_address5[addr_line1]
to Update.php