0
votes

Here is the code of my color picker. http://jsfiddle.net/7jg4e/728/

<img id="1" alt="test"  src="https:/test.com/IMGService.ashx?imagetype=typeit&amp;postid=7406&amp;width=100%&amp;height=142&amp;RenderText=[field title]&amp;TextSize=96&amp;TextColor=%23ff0000&amp;BgColor=%23ffffff"> 

Here is my img tag which is api convert text into image. i want to add colopicker to this image tag so user can change the color of image so i have colorpicker and every colorpick's out put with javascript or with Jquarry we need to use id tag but how i can get color name value in my BgColor=
I hope you understand my point. i mean i want if user use color picker and pick one color its automatic update in BgColor in img filed like bellow

<img id="1" alt="test"  src="https:/test.com/IMGService.ashx?imagetype=typeit&amp;postid=7406&amp;width=100%&amp;height=142&amp;RenderText=[field title]&amp;TextSize=96&amp;TextColor=%23ff0000&amp;BgColor=%23**Color Picker color value Here**">

I want print colorpicker value here. is it possible

;BgColor=%23**Color Picker color value Here**">  

Sorry For Poor English.

1
Why do you need an API for this? - aloisdg
@aloisdg Hi, thanks for reply, no i mean this is api service i used here , it have value which provide background color so i want to print color value here when user pick color from colorpicker. hope you got my point - deccc
@aloisdg You can ignore the api line from my question. i just want to know is it possible to print colorpicker value in bgcolor= "Here " with javascript or not if yes then how if not the can php do this ? - deccc

1 Answers

2
votes
let src = 'URL' + $('#color').val().replace('#','');
$('#1').attr('src', src);

Id 1 should not be valid within js/jquery.