• Resolved wolfenr

    (@wolfenr)


    Hi, I have a field in which I want to put a clickable image and, as every record has the same image, would like to set it as the default value for the field but, when I do that, various parts of the image link get escaped and am not sure how to resolve this.

    If I manually enter the code into each record it works fine using the following…

    <code><a title="Scroll to top" href="#scroll-top"><img class="alignnone size-full wp-image-725" src="https://www.cab.rogw.net/wp-content/uploads/2017/08/arrow-up.png" alt="" width="19" height="23" /></a></code>

    However if I try and set it to a default value as a Rich Text field it becomes as follows with all the quotes escaped…

    <code><a title=\"Scroll to top\" href=\"#scroll-top\"><img class=\"alignnone size-full wp-image-725\" src=\"https://www.cab.rogw.net/wp-content/uploads/2017/08/arrow-up.png\" alt=\"\" width=\"19\" height=\"23\" /></a></code>

    Any ideas?
    My thanks

    Edit: Just tried to resolve this a different way via phpmyadmin > change the field type to VARCHAR > set a default value for the field.
    I’m not ace on MySQL and it failed but it may be the germ of an idea.

    • This topic was modified 7 years, 1 month ago by wolfenr. Reason: Tried to resolve with MySQL changes

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author xnau webdesign

    (@xnau)

    The plugin is set up to prevent complex HTML in things like default values for security reasons.

    What you need is a special type of field…take a look at this tutorial on setting that up:

    A Custom Form Element that Simply Displays HTML

    Thread Starter wolfenr

    (@wolfenr)

    Thank you so much for that @xnau. It worked just fine.

    I changed the field name that I wanted to from ‘signup’ to ‘up’ (for my up arrow image) in line 122 of your code, set the Form element to HTML, the Value to my HTML code and the Validation to Required.

    I tested by entering a new record which worked but it also auto populated all my older records with the same HTML code.

    Excellent work. My thanks again.

    • This reply was modified 7 years, 1 month ago by wolfenr.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Clickable image as default field value’ is closed to new replies.