Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2010
    Location
    Bonners Ferry, Idaho
    Posts
    69
    Plugin Contributions
    1

    Default How can I change a default submit button in a sidebox to an image button?

    Hello, In my MailChimp sidebox I am trying to edit the default submit button code to use an image instead of the default grey "submit" button.

    The current code:
    Code:
    $content .= '<input type="submit" name="submit" value="'Subscribe now" />';
    All I want to do it change it to be an image from my templates image folder: Button_Submit.png
    I can reference the image correctly using the code here:
    Code:
    debug.print zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . 'cButton_Submit.png')
    However I am having a hard time getting the image to display as the submit button. I am trying to use:
    Code:
    $content .= '<input type="submit" width="300" height="200" name="submit" style="background-image: url(../../../../images/icons/Button_Subscribe.png);" value="Subscribe Now" />';
    and it works.. kinda. But instead of replacing the button it just adds the image to the middle of that ugly default grey button. How can I make it actually replace the old button?
    Thanks,
    Jacob

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: How can I change a default submit button in a sidebox to an image button?

    To use only an image, instead of a normal submit button:
    Change
    Code:
    <input type="submit"
    to
    Code:
    <input type="image"
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Mar 2010
    Location
    Bonners Ferry, Idaho
    Posts
    69
    Plugin Contributions
    1

    Default Re: How can I change a default submit button in a sidebox to an image button?

    Thanks!

 

 

Similar Threads

  1. How can I make the submit button align center?
    By bnamodel in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 7 Aug 2009, 09:43 AM
  2. How to change "Submit" button Properties to different url?
    By actorxfactor in forum Templates, Stylesheets, Page Layout
    Replies: 27
    Last Post: 2 Jun 2009, 06:21 PM
  3. How to change 'Search Button' in sidebox?
    By billybonds in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 21 Jun 2007, 03:00 PM
  4. Text Sidebox button to Image sidebox Button
    By xavierlim in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 28 Feb 2007, 09:57 AM
  5. replace submit button with image?
    By godt in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 28 Sep 2006, 05:39 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR