Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Color picker (http://www.mysidiaadoptables.com/forum/showthread.php?t=5576)

Missy Master 08-24-2018 11:23 PM

Color picker
 
Does anyone know a simple way to use color picker with the latest version?

I want to use that to change colors on bases.



I've never gotten the hang of CP, sadly!

Dinocanid 08-26-2018 07:12 PM

You could use a color picker with an HTML form, like:
PHP Code:

$document->add(new Comment("<form action='PAGENAME' method='post'>
<input type='color' id='color' name='color' value='#e66465' />
<button id='submit' value='submit' name='submit type='submit'>Pick Color!</button>
</form>"
)); 

Replace PAGENAME with the whatever page you use this on. If used in blankview.php for example, you would replace it with "blank".

To get the data from the form, use this:
PHP Code:

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
            
$mycolor $_REQUEST['color'];
            
$document->add(new Comment("The color you picked was {$mycolor}!"));
//a database statement could also go here if you want to store the chosen color
            
return;
        } 

That's just getting the color though. I'm not entirely sure how to apply the chosen color to pets.

Missy Master 08-27-2018 10:13 AM

I might be able to work that out. :)

Thank you so much, I appreciate the tips!


All times are GMT -5. The time now is 10:56 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.