5 Responses to Affiliate Area Login and Register Button Styling

  1. Andrew February 21, 2014 at 7:05 pm #

    Thank you for your reply. As far as I am aware, getElementByName is only available on IE, no? I haven’t gotten it to work on Chrome, Safari, etc, but maybe I am doing something wrong.

    I have read that it is not proper to embed JQuery into a WordPress page, so I would need to run it site-wide, which I don’t want to do.

    Can you please help me with the code, and post a specific resolution to the way the buttons on your page are configured?

    Thank you so much.

    • kento February 23, 2014 at 11:26 am #

      That function is not available in IE <= 9, see this test page and also DOM Core for a comparison of supporting browsers.

      Regarding this:

      “I have read that it is not proper to embed JQuery into a WordPress page, so I would need to run it site-wide, which I don鈥檛 want to do.”

      Whoever wrote that needs to learn more 馃槈 The opposite is true, a resource should only be loaded where it is required. Just like you don’t carry around a toolbox in real life unless you need it.

      The immediate solution for this is to include jQuery on that page and use the code indicated above 馃檪

  2. Andrew February 20, 2014 at 6:02 pm #

    Thank you for your reply and code. I don’t want to run JQuery on a WordPress page directly.
    Unfortunately I can’t grab the node by name easily. I thought maybe a javascript function could look for the name once it has found the input type submit, but I am not sure how to do that.
    Is there any other way to change the second button without hardcoding it in the php file?


  3. kento February 20, 2014 at 1:26 pm #

    Hi Andrew,

    Good questions, there are a couple of sensible solutions that I can think of.

    For the login button you could add the required classes via Javascript, the ID of the button is wp-submit:

    var submitButton = document.getElementById("wp-submit");
    submitButton.className = submitButton.className + " small green button";

    Assuming you’d be ok with using jQuery for that, you can use this to add the classes to both the login button and the sign-up button:

    $("#wp-sumit").addClass("small green button");
    $('[name="affiliates-registration-submit"]').addClass("small green button");

    And the other option would be to provide filters for the classes but the above would be an immediate solution for you.

We use cookies to optimize your experience on our site and assume you're OK with that if you stay.
OK, hide this message.

AffiliatesContactJobsTerms & ConditionsPrivacy PolicyDocumentationDownloadsUseful PluginsMy Account