CodeIgniter Forums
how to disable submit button when value is not null - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: how to disable submit button when value is not null (/showthread.php?tid=72006)



how to disable submit button when value is not null - kvanaraj - 10-24-2018

I am using table row to display records
Code:
echo '<tr>';                    
                   echo '<td align="center">'.$sno++.'</td>';
                   echo '<td>'.$row['doctype'].'</td>';
--Upload button --
 echo '<td>'.$row['status'].'</td>';

once images uploaded the status changed into 1.
if this all $row['status'] is null then disable submit button else 
enable.
need suggestion


RE: how to disable submit button when value is not null - InsiteFX - 10-24-2018

You know were getting tried of answering the same questions over and over!

Use Google search instead of expecting us to do your coding for you.

Button disabled Property

Or use jQuery toggle


RE: how to disable submit button when value is not null - Gurutechnolabs - 11-06-2018

You can need to use any validator library, for example, => http://1000hz.github.io/bootstrap-validator/

Give all validation functionality by default and also possible with customization as per you need


RE: how to disable submit button when value is not null - kvanaraj - 11-09-2018

(10-24-2018, 08:43 AM)InsiteFX Wrote: You know were getting tried of answering the same questions over and over!

Use Google search instead of expecting us to do your coding for you.

Button disabled Property

Or use jQuery toggle

Those values are not input type element. readonly values . how?


RE: how to disable submit button when value is not null - InsiteFX - 11-09-2018

Code:
// jQuery
// Disabling a html button
$('#Button').prop('disabled', true);

// Enabling a html button
$('#Button').prop('disabled', false);



RE: how to disable submit button when value is not null - kvanaraj - 11-16-2018

(11-09-2018, 04:37 AM)InsiteFX Wrote:
Code:
// jQuery
// Disabling a html button
$('#Button').prop('disabled', true);

// Enabling a html button
$('#Button').prop('disabled', false);

Code:
$('#mytable tr').each(function() {
   if (!this.rowIndex) return; // skip first row
   var customerId = this.cells[2].innerHTML;
   alert(customerId);
   if(customerId != 'Uploaded'){  // Im understand that innerHTML return text value
    $('#next').prop('disabled', true);
  }
   
});
My table display 5 rows . if 5 rows should be return as uploaded then next button will be enabled else disabled. need suggestion