Remove a display image based on AJAX

Based on entry of STYLEID I display a photo found on that record.

If make an error and need to enter a new styleid value, and there is no image on the record, I want the image to clear. I can’t get that to happen

Here is code
{photoDisplay}="";

$check_sql = “SELECT photo1”
. " FROM tblStyle"
. " WHERE styleid = ‘" . {styleid} . "’";
sc_lookup(rs, $check_sql);

if (isset({rs[0][0]})) // Row found
{
{photoDisplay} = {rs[0][0]};

if({photoDisplay}>" ")
	{
	echo " photo exists";
    ;}
	else
	{{photoDisplay} = "";
	echo " photo not exists";
	
	}

;}

Is there such a thing as a CLEAR command

May be a goofy workaround but can you just have a jpg or such that is a blank gray/white/whatever square that is displayed for a “not found” image?

That would look strange, depending on the theme chosen.

But you gave me the answer, I am using sc field hide, which just hides the entire field

Tks

1 Like