Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Flex's avatar
Level 4

how to save bootstrap color picker values to data table

using bootstrap color picker plugin http://www.expertphp.in/article/simple-jquery-bootstrap-color-picker-plugin-example to store color values in My laravel app. I need how to grab color value to store when I select color from picker

 <input type="text" value="#00AABB" class="form-control" />
0 likes
4 replies
Mittensoff's avatar

Well you just need to add a name attribute to the input field you provided.

 <input type="text" value="#00AABB" name="color_picker" class="form-control" />

Then access it in your controller with $request->color_picker.

If that's what you're asking for.

2 likes
shakti's avatar

Sorry but i wasn't able to grab your question in the link you have provided they have mention a demo link in which they provide the color code which you want.

In your code you are missing name & id field please add then something like this

<input type="text" value="#00AABB" name="color_name" class="form-control" />

and in your controller you can call them something like

$color=$request->color_name
1 like
Flex's avatar
Level 4

@Mittensoff @shakti actually I need when I add this plugin to My laravel app and when I select new color and save it to table. I am not clear in this artical how to send new selected color code to table. I need clear it. Thanks!

Mittensoff's avatar

You don't know how to make a form or is it something else?

Please or to participate in this conversation.