I have the following code:
$theinput = new inputSmartSearch($db,
"chooseproduct", "Choose Product", $therecord["product"],
"Choose Product", TRUE, NULL, NULL, TRUE, $required=true);
$theinput->setAttribute("class","important");
if(isset($therecord["product"]) || isset($therecord["cost"])) {
$theinput->setAttribute("value",
$therecord["product"] . ", " . $therecord["cost"]);
}
inputSmartSearch is a type of form field for a CMS system I am using.
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.
var_dump($therecord["product"]);
shows string(0) "", so it is certainly empty.
Why then is ", " still being set as the default value of my form field?