In the html form, how do you have the color choice and how it is sent to the database

I am creating an html form in Dreamweaver and it requires the user to select a color. Now I continued to work with a small widget browser and added a jquery widget to select the color that they had. My question, however, is how can I send this information to the sql database that I created. Another form of question will be what type of data will have color.

Thanks in advance!

+3
source share
4 answers

Just use the varchar (6) field in your database and simple <input type="text" maxlength="6" size="6" />on your page.

/ , , jQuery, " ". , , , . , , , 000000 , FFFFFF . .

.

, , , , , , . , , Javascript, , .

, .

+2

sql , : http://blog.meta100.com/post/600571131/mcolorpicker

varchar (6).

EDIT: char (6).

+1

script, . ajax (http://api.jquery.com/jQuery.ajax/). ?

0

Thanks to HTML5, you can simply use the new type of input field "color":

<input type="color" name="my_color" />

Form submission submits it as a hex color value (e.g. white = #ffffff)

0
source

All Articles