CodeIgniter Forums

Full Version: how to disable submit button when value is not null
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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
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
(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?
Code:
// jQuery
// Disabling a html button
$('#Button').prop('disabled', true);

// Enabling a html button
$('#Button').prop('disabled', false);
(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