I want to have the checkbox seleted if the productNeedsAudit from the Json value is True. But I new to php and I am also stuck implementing the logic with an echo statement. I am trying the following:
echo "<tr><td><div class='control-group controls'>
<label for='productNeedsAudit'>
<input name='productNeedsAudit' type='checkbox'id='productNeedsAudit' value='True'" . $soJson->{'productNeedsAudit'} == 'True' ? 'checked' : '' . ">
Needs Audit
</label>
</div></td></tr>";
In the results, the check box isn't selected. Instead, I am getting the following in the web browser.
> Needs Audit
Here's the HTML
<table>
<tr>
<td>
<select style='width: 100%;' id='productType' name='productType'>
<option value='TEST: TEST</option>
</select>
</td>
</tr>
<tr>
<td>
<div class='control-group controls'>
<label for='productDescription'>Description: </label>
<input type='text' name='productDescription' value='*.1stdibs.com, *.1stdibs.us.com' />
</div>
</td>
</tr>
<tr>
<td>
<div class='control-group controls'>
<label for='productPriceBookDescription'>Price Book Description: </label>
<input type='text' id='priceBookDesc' name='productPriceBookDescription' style='width:100%' value='' />
</div>
</td>
</tr>
/>
Needs Audit
</label>
</div></td></tr>
<tr>
<td>
<div class='control-group controls'>
<label for='productServiceOrderNumber'>Service Order: </label>
<select id='productServiceOrderNumber' name='productServiceOrderNumber'>
<option value='992769:53:14' selected='selected'>992769:53:14</option>
</select>
</div>
</td>
</tr>
<tr>
<td>
<input id='subcustomers' name='subcustomers'>
</input>
<input id='subproducts' name='subproducts'>
</input>
</td>
</tr>
<tr>
<td>
<input id='tags' name='tags'>
</input>
</td>
</tr>
</td></tr>
</table>