Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing the color of a bootstrap button
Message
De
26/12/2016 16:24:19
 
 
À
26/12/2016 15:52:52
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
Information générale
Forum:
PHP
Catégorie:
Autre
Divers
Thread ID:
01646032
Message ID:
01646092
Vues:
27
>>>>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.

Thank you, Jim
Yes, I'm embedding the PHP code.
I'll look into classes
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform