[open] Form button with both text and image
The documentation implies that form buttons are mutually exclusive, with regard to text and images. Is there any way I can create a button that has both?
Thanks;
C
The documentation implies that form buttons are mutually exclusive, with regard to text and images. Is there any way I can create a button that has both?
Thanks;
C
Comments
Hi C,
The simplest way to bipass this limitation would be to use images that already contain text. I can imagine that this would be harder if the text depends on the experimental condition. The always existant solution is to use an inline_script instead of a form. You could create a canvas and display a combination of text and image somewhere. To pass it as a button, you would have to gather mouse response coordinates, and incorporate an if-statement to indicate e.g. "if coordinates are within button range, do this".
Cheers
Josh
Thanks, Josh
Yeah, those are the conclusion I had come to... Although, I did have another thought which I've not tried: The text in buttons (amongst other things) is rendered as HTML. Is there any restriction on that? Could one, for example, use an
imgtag with an absolute path/data URI as the source?Thanks;
C
...It was worth a try, but the
imgtag didn't work with either a remote file or local file (I didn't bother trying a data URI).I'll implement Josh's suggestion if needs be.
Thanks;
C
Yes, it's just a very limited set of tags for basic formatting, not a full HTML renderer. See also:
Check out SigmundAI.eu for our OpenSesame AI assistant!