ребят как передать цвет по переменной?
_________________
/////выбор цвета/////
_________________
HTML5 |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| <form method="post" action="ads?page=post">
<table class="tables">
<td><b>Описание ссылки:</b></td>
<div class="row">
<select class="styled-select" id="counts_mix" onChange="show_mix();">
<option value="0" selected disable>Нет</option>
<option value="1">Да</option>
</select>
</div>
<td><input type="text" name="text" maxlength="160"
class="ok"></td>
<td><span id="q2" style="display: none;">
<select id="init" name="colorpicker-picker-longlist">
<option value="#7bd148">Green</option>
<option value="#5484ed">Bold blue</option>
<option value="#a4bdfc">Blue</option>
<option value="#46d6db">Turquoise</option>
<option value="#7ae7bf">Light green</option>
<option value="#51b749">Bold green</option>
<option value="#fbd75b">Yellow</option>
<option value="#ffb878">Orange</option>
<option value="#ff887c">Red</option>
<option value="#dc2127">Bold red</option>
<option value="#dbadff">Purple</option>
<option value="#e1e1e1">Gray</option>
</select></span></td>
<td align="center">
<input type="submit" value="Перейти к оплате"/></a></td>
</table></form> |
|
_________________
/////JS для выбора цвета/////
_________________
Javascript |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
| // выбор цвета
$(document).ready(function() {
$('select[name="colorpicker-change-background-color"]').on('change', function() {
$(document.body).css('background-color', $('select[name="colorpicker-change-background-color"]').val());
});
$('#init').on('click', function() {
$('select[name="colorpicker-shortlist"]').simplecolorpicker();
$('select[name="colorpicker-longlist"]').simplecolorpicker();
$('select[name="colorpicker-notheme"]').simplecolorpicker();
$('select[name="colorpicker-regularfont"]').simplecolorpicker({theme: 'regularfont'});
$('select[name="colorpicker-glyphicons"]').simplecolorpicker({theme: 'glyphicons'});
$('select[name="colorpicker-fontawesome"]').simplecolorpicker({theme: 'fontawesome'});
$('select[name="colorpicker-bootstrap3-form"]').simplecolorpicker({theme: 'glyphicons'});
$('select[name="colorpicker-modal-inline"]').simplecolorpicker();
$('select[name="colorpicker-modal-picker"]').simplecolorpicker({picker: true});
$('select[name="colorpicker-option-selected"]').simplecolorpicker({theme: 'glyphicons'});
$('select[name="colorpicker-options-disabled"]').simplecolorpicker({theme: 'glyphicons'});
$('select[name="colorpicker-option-selected-disabled"]').simplecolorpicker({theme: 'glyphicons'});
$('select[name="colorpicker-optgroups"]').simplecolorpicker();
$('select[name="colorpicker-change-background-color"]').simplecolorpicker();
$('select[name="colorpicker-selectColor-#fbd75b"]').simplecolorpicker({theme: 'glyphicons'});
$('select[name="colorpicker-selectColor-#FBD75B"]').simplecolorpicker({theme: 'glyphicons'});
$('select[name="colorpicker-selectColor-#fbd75b-multiple"]').simplecolorpicker({theme: 'glyphicons'});
$('select[name="colorpicker-selectColor-unknown"]').simplecolorpicker({theme: 'glyphicons'});
$('select[name="colorpicker-picker-shortlist"]').simplecolorpicker({picker: true, theme: 'glyphicons'});
$('select[name="colorpicker-picker-longlist"]').simplecolorpicker({picker: true, theme: 'glyphicons'});
$('select[name="colorpicker-picker-delay"]').simplecolorpicker({picker: true, theme: 'glyphicons', pickerDelay: 1000});
$('select[name="colorpicker-picker-option-selected"]').simplecolorpicker({picker: true, theme: 'glyphicons'});
$('select[name="colorpicker-picker-options-disabled"]').simplecolorpicker({picker: true, theme: 'glyphicons'});
$('select[name="colorpicker-picker-option-selected-disabled"]').simplecolorpicker({picker: true, theme: 'glyphicons'});
$('select[name="colorpicker-picker-optgroups"]').simplecolorpicker({picker: true, theme: 'glyphicons'});
$('select[name="colorpicker-picker-selectColor-#fbd75b"]').simplecolorpicker({picker: true, theme: 'glyphicons'});
$('select[name="colorpicker-picker-selectColor-unknown"]').simplecolorpicker({picker: true, theme: 'glyphicons'});
});
$('#destroy').on('click', function() {
$('select').simplecolorpicker('destroy');
});
// By default, activate simplecolorpicker plugin on HTML selects
$('#init').trigger('click');
}); |
|
ну и сам маленький PHP код в который нужно передать цвет
PHP |
1
2
3
4
5
6
7
8
9
| $colors_op=htmlspecialchars($_POST['colors_op']);
___
<b>цвет описания</b> + $colors_op<br>
____
//сам вывод текста
<div class=\"top-promo-in\">
<font color=\"$colors_op\"><p>$text</p></font>
</div> |
|