sunshine sunshine - 3 months ago 9
Javascript Question

How to hide a submit button in codeigniter

How to hide the submit button when

$row['completion_status']=='completed'
.

My
view code
is:



<input type="submit" <?=($row[ 'checklist_id']=="Denied" ||$row[ 'checklist_id']=="Approved" ||$row[ 'completion_status']=="completed" )? "disabled='true'": "";?>name="sumit_button"
value="Update"
class="btn"
style="float:left;background:#d8d8d8;color:#000;box-shadow:0px 0px 1x rgba(0,0,0,0.2)!important;">




Answer

try like this code

<?php 
  $display = ($row[ 'checklist_id']=="Denied" ||$row[ 'checklist_id']=="Approved" ||$row[ 'completion_status']=="completed" )? "display:none": "display:block";
?>
<input type="submit" name="sumit_button" 
   value="Update" 
   class="btn" 
   style="float:left;background:#d8d8d8;color:#000;box-shadow:0px 0px 1x rgba(0,0,0,0.2)!important;<?php echo $display; ?>">