setting a form field if a table field is not empty
<p>I have the following code:</p>

<pre><code>$theinput = new inputSmartSearch($db,
    "chooseproduct", "Choose Product", $therecord["product"],
    "Choose Product", TRUE, NULL, NULL, TRUE, $required=true);
$theinput-&gt;setAttribute("class","important");
if(isset($therecord["product"]) || isset($therecord["cost"])) {
    $theinput-&gt;setAttribute("value",
        $therecord["product"] . ", " . $therecord["cost"]);
}
</code></pre>

<p>inputSmartSearch is a type of form field for a CMS system I am using.</p>

<p>What I am wanting to do to set the value of the form by default, as long as it is not empty, to avoid having the ", " be the default value.</p>

<pre><code>var_dump($therecord["product"]); 
</code></pre>

<p>shows string(0) "", so it is certainly empty.</p>

<p>Why then is ", " still being set as the default value of my form field?</p>
