When I am adding a new record via my add.php script, I'd like to add some code that functions as follows: if an invoice number is entered, set status as "Closed". I thought I could do this with the following code but when I view the data in the DB (after typing in an invoice #), I see it did not work:
Code: Select all
<p><span class="style9">Invoice #</span><br><input name="invoiceNum" id="invoiceNum" type="text" class="style10" size="20"></p><?php
if ($myrow["invoiceNum"] != "") { $myrow["status"] = "Closed"; }
For what it's worth, I do have the following bit of code before the above code:
Code: Select all
<select name="status" class="style12" id="status">
<option selected>Open</option>
<option>In-Process</option>
<option>Closed</option>
</select>