Now we are discussing how to add color picker in php/html project, for example if you want give a functionality to user select color from color picker for his background color profile,for this we will use third party color picker and call it on particular div area where we want display color picker.
Step 1: first we will include farbtastic css and js file.
<script type="text/javascript" src="js/colorpicker/farbtastic.js"></script> <link type="text/css" rel="stylesheet" href="css/farbtastic.css" />
Step 2: we will call color picker method on document ready event.
$(document).ready(function () { $('#pickerleft').farbtastic('#colorleft'); });
colorright/ colorleft’ is text-box id where we will show color id
Step 3: we will create html template for display color picker.
<table width="100%"> <tr><td colspan="2" height="34px;" ><h4 class="green-text roundeddiv shadowImgae" style="padding-left:22px;">Background Color Management:</h4></td></tr> <tr> <td width="27%" style="padding-right:20px;"><div id="pickerleft"></div></td> <td width="70%" > <form action="index.php?action=bgcolor&mode=add" method="post" enctype="multipart/form-data"> <table><tr><td> <label for="file">left<label><td> <td><input type="text" id="colorleft" name="colorleft" value="<= $bg_colorleft ?>" /> </td> </tr> </table>
This tutorial helps integrate a PHP SDK with Laravel. We'll install aws-php-sdk into laravel application and access all aws services… Read More
in this quick PHP tutorial, We'll discuss php_eol with examples. PHP_EOL is a predefined constant in PHP and represents an… Read More
This Laravel tutorial helps to understand table Relationships using Elequonte ORM. We'll explore laravel table Relationships usage and best practices… Read More
We'll explore different join methods of Laravel eloquent with examples. The join helps to fetch the data from multiple database… Read More
in this Laravel tutorial, We'll explore valet, which is a development environment for macOS minimalists. It's a lightweight Laravel development… Read More
I'll go through how to use soft delete in Laravel 10 in this post. The soft deletes are a method… Read More
View Comments
hi i need a full code plz send me full java script of color picker for php
Just copy and paste codein your html page.