Message
From
26/12/2016 15:52:52
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
 
To
25/12/2016 23:35:02
General information
Fórum:
PHP
Category:
Miscellaneous
ID da thread:
01646032
ID da mensagem:
01646090
Views:
29
>>>Is it possible to change the color a bootstrap button if a condition exists?
>>>If so, can you please post some sample code?
>>
>>Not clear if you want change the color at run time or while rendering the html. In either case, there are several classes built into bootstrap to change the color. If that is not what you want then you can always create your own classes to override the bootstrap classes. Jquery makes it easy to change at run time or in php you just us a condition to apply the appropriate class.
>
>James
>I want to change it a run time based on data conditions.
>Can you give me a PHP sample?

All it takes is an if condition. The problem is there are so many ways of doing this in PHP now. Do you in bead PHP code in the html (the old way) or are you doing this in PHP classes?
// in html 
<input type="button" class="<?php  (some condition) ? 'class1' : 'class2' ?>" value="button name" />
Post some code If that doesn't work for you.
Previous
Next
Responder
Mapa
View