i have an input field which will be displayed. i want that to hide when a variable from my php script is set.
i would like to know if that is possible. i know there is a way with
<input type="hidden">
but like i know there is just javascript to make this field visible. so i ask for other way round.
i have
<input type="text">
and would like to hide it with
<?php if(isset($var) && $var =="1"):?>
is there a way to realize that? thanks alot.
okay what i was looking for is:
<input type="<?php echo ($var === '1' ? 'hidden' : 'text'); ?>">
that is exactly what i need. another question: is there a way to implement that to a select option field? thanks.
Try:
If
$varis=to1then set type attribute to hidden.Update: