WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Input type=image (7 posts)

  1. jdlejeune
    Member
    Posted 7 years ago #

    Hello. I'm attempting to insert a Paypal button and it keeps stripping out the src= for my <input type=image> tag. Anyone else experiencing this or know how to correct it?

    Many thanks.
    JD

  2. yosemite
    Member
    Posted 7 years ago #

    Insert in a post?

    Try turning off the visual editor (wywsiwig)?

  3. jdlejeune
    Member
    Posted 7 years ago #

    Thanks so much Yosemite. I disabled the tinyMCE under the admin profile and then uploaded the Xinha4WP plugin. It works like a charm :D

    Peace,
    JD

  4. yosemite
    Member
    Posted 7 years ago #

    Welcome! Please mark this resolved, them?

  5. jdlejeune
    Member
    Posted 7 years ago #

    Yes, this is resolved. Do I need to mark it resolved?

  6. spencerp
    Member
    Posted 7 years ago #

    Yup..Wouldn't hurt. This way, everyone will know, that this problem has been taken care of. ;) =) And, it also helps "us" mods know what/where useful threads are, for certain problems and fixes for those problems. =) ;)

    spencerp

  7. James Revillini
    Member
    Posted 7 years ago #

    here's another workaround so the button can work with TinyMCE, but i admit it's a bit insane. i should make a plugin out of it if anyone thinks it's worth it.

    prerequisites: be willing and able to edit your header.php file and insert some scripts into the head section. be willing and able to upload the prototype library to your site.

    ok, here goes:

    1) create your button in paypal and copy their form code and paste it into the HTML editor for TinyMCE.

    2) find the line that has something like:
    src="https://www.paypal.com/en_US/i/btn/x-click-but24.gif"

    3) change the 'src' part to 'class'. yes, this is strange but you'll see. it will work.

    4) click 'Update' so the thing is saved.

    5) download prototype.js from wherever (just google it) and upload it to /js/ (which means a js directory right off the root of your site)

    6) insert the following code into the <head> section of header.php within your theme directory:

    <script type="text/javascript" src="/js/prototype.js"></script>
    <script type="text/javascript">
    window.onload = function () {
    var inputs = document.getElementsByTagName('input');
    $A(inputs).each(
    function (input) {
    if (input.type=='image') { input.src=input.className;Element.setStyle(input, {margin:0,padding:0,border:0,background:'transparent'}); }
    }
    );
    }; //end window.onload
    </script>

    That should be it. There's a preview of this working at http://veganpeople.net/fun-ways-to-help/

    I don't claim that this won't screw up other plugins. This code is going to operate on ANY input image within your blog without discretion.

    So, make sure you back up everything you touch before you do it. Lots of luck to all. Let me know if this was useful and if there's enough interest I'll see about putting a plugin together and making the code a little more discriminate so it only touches paypal buttons.

Topic Closed

This topic has been closed to new replies.

About this Topic