Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] Form button with both text and image

edited August 2015 in OpenSesame

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

  • edited 8:46AM

    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

  • edited August 2015

    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 img tag with an absolute path/data URI as the source?

    Thanks;
    C

  • edited 8:46AM

    ...It was worth a try, but the img tag 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

  • edited 8:46AM

    The text in buttons (amongst other things) is rendered as HTML. Is there any restriction on that?

    Yes, it's just a very limited set of tags for basic formatting, not a full HTML renderer. See also:

Sign In or Register to comment.