I am trying to workout the following JavaScript if statement:
<script>
if ($crs_date2 != '0000-00-00'){
document.write('No other course date available');
} else {
document.write(<button class='btn btn-danger data-toggle='modal' id='actionButtonOrange'>$crs_date2</button>);
}
</script>
I am encountering two issues:
- The button is not being displayed.
- the function does not seem to be working as intended.
Essentially what would happen is that if no date is available (by default it displays 0000-00-00 if no date is available but it is not aesthetically pleasing), the JavaScript message appears.
Aucun commentaire:
Enregistrer un commentaire