- This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
Viewing 9 posts - 1 through 9 (of 9 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I’m trying to come up with a solution, where if a div is empty, I would like to add a class so that I can display:none;. I tried searching without any luck.
I don’t know how to write this expression though? Any help would be appreciated :)
echo $errors;
echo $errors;
echo $errors;
echo $errors;
?>
I don’t really know what you’re doing… but what if it was more like this:
// do nothing
} else { ?>
I have a div that contains all my errors on a form. I have it styled and positioned where needed, but when there are no errors, I would like the div to not be visible.
I’m going to see if I can work with the idea above, thanks.
Well that’s not going over too well lol. I tried writing that function ( I always get mixed up about the names of php [statements/expressions/functions]) outside the div, inside the class=”” itself and lots of different ways, I could never get it to work. I think I was doing it wrong, but not sure?
I’m not the strongest with PHP, so my solution might not be EXACTLY what you need to write.
Thanks for trying @TheDoc.
Even with my limited knowledge, there has to be something we can do! What code did you try?
Sweet, I asked a buddy and he helped out. I was thinking of it the same way and trying like you said, if empty do not display vice if not empty display.
if(!empty($errors)){
echo '';';
echo $errors;
echo '
}
?>
I think that’s what he finished with there.