Forums / Templates, Stylesheets, Page Layout / How can I change a default submit button in a sidebox to an image button?

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

Views: 1,081

Results 1 to 3 of 3
17 Aug 2016, 11:28 PM
#1
jacobbushnell avatar

jacobbushnell

New Zenner

Join Date:
Mar 2010
Location:
Bonners Ferry, Idaho
Posts:
69
Plugin Contributions:
0

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: ```
$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:

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: ```
$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

18 Aug 2016, 3:30 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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 <input type="submit"to```
<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.

18 Aug 2016, 6:17 PM
#3
jacobbushnell avatar

jacobbushnell

New Zenner

Join Date:
Mar 2010
Location:
Bonners Ferry, Idaho
Posts:
69
Plugin Contributions:
0

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

Thanks!