Author Topic: Pagesettings (overview)  (Read 2992 times)

Offline Shefra

  • Posts: 90
  • Gender: Male
Pagesettings (overview)
« on: September 01, 2011, 08:20:20 PM »
Hello,

I want to change the input type from submit to image:

Quote
<form action="[SHOP_URL]" method="post">
<input type="submit" name="view_cart" class="mod_bakery_bt_cart_ f" value="[VIEW_CART]" />
</form>

to

Quote
<form action="[SHOP_URL]" method="post">
<input type="image" src="http://<websitename>/<image.img> name="view_cart" class="mod_bakery_bt_cart_ f"  />
</form>

When i click on the image the webshop is reloaded instead of showing the cart.

Do i overlook something?

Thanks

Frank


freeSbee

  • Guest
Re: Pagesettings (overview)
« Reply #1 on: September 01, 2011, 08:48:22 PM »

Offline Shefra

  • Posts: 90
  • Gender: Male
Re: Pagesettings (overview)
« Reply #2 on: September 02, 2011, 09:22:13 AM »
Do i missing something? I read this section but i can use the input type="image" as well but is doesn't work.

freeSbee

  • Guest
Re: Pagesettings (overview)
« Reply #3 on: September 02, 2011, 10:30:30 AM »
Please post or pm a link to the site.

Regards Christoph

Offline DarkViper

  • Forum administrator
  • *****
  • Posts: 3043
  • Gender: Female
Re: Pagesettings (overview)
« Reply #4 on: September 02, 2011, 10:50:17 AM »
Hello,

I want to change the input type from submit to image:

Quote
<form action="[SHOP_URL]" method="post">
<input type="submit" name="view_cart" class="mod_bakery_bt_cart_ f" value="[VIEW_CART]" />
</form>

to

Quote
<form action="[SHOP_URL]" method="post">
<input type="image" src="http://<websitename>/<image.img> name="view_cart" class="mod_bakery_bt_cart_ f"  />
</form>

When i click on the image the webshop is reloaded instead of showing the cart.

Do i overlook something?

Thanks

Frank




so it should work.

Code: [Select]
<form action="[SHOP_URL]" method="post">
    <input type="hidden" name="view_cart" value="[VIEW_CART]" />
    <input type="image" src="http://websitename/image.img" name="view_cart_submit" class="mod_bakery_bt_cart_f" alt="[VIEW_CART]" />
</form>

why?
Your Input-Image-Tag does not submit a value ([VIEW_CHART]), that's why the script goes the default direktion (reload).
By the Hidden-Input-Tag now the value for $_POST['view_cart'] is submitted explicitly and all should work well again.
PS: an image needs the Alt-property also.
« Last Edit: September 02, 2011, 10:56:40 AM by DarkViper »
Der blaue Planet - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen

"You have to take the men as they are… but you can not leave them like that !" :-P
Das tägliche Stoßgebet: Oh Herr, wirf Hirn vom Himmel !

freeSbee

  • Guest
Re: Pagesettings (overview)
« Reply #5 on: September 02, 2011, 11:43:18 AM »
Bakery just uses the name attribute for controlling. But since the value attribute hast to be set and must not be empty just add it to the <input type="image" ... /> tag:

Code: [Select]
<form action="[SHOP_URL]" method="post">
<input type="image" src="http://www.yourwebsite/your_directory/your_image.img>" name="view_cart" value="[VIEW_CART]" alt="[VIEW_CART]" class="mod_bakery_bt_cart_ f" />
</form>

Regards Christoph
« Last Edit: September 02, 2011, 11:57:50 AM by freeSbee »

Offline DarkViper

  • Forum administrator
  • *****
  • Posts: 3043
  • Gender: Female
Re: Pagesettings (overview)
« Reply #6 on: September 02, 2011, 12:03:12 PM »
value = "" inside an input tag of type image can be a trap to run in an issuse.

Quote
Note:
For graphical buttons not only of any existing value in the attribute value is transferred, but additionally the coordinates of the click on the image. The (as of PHP from name_x / name_y) states, two additional values ​​sent in the form and Name.x name.y. IE will only send the coordinates.
(translated by google from german website SelfHTML

so the better and more secure solution is to use a input-hidden tag.
« Last Edit: September 02, 2011, 12:05:04 PM by DarkViper »
Der blaue Planet - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen

"You have to take the men as they are… but you can not leave them like that !" :-P
Das tägliche Stoßgebet: Oh Herr, wirf Hirn vom Himmel !

freeSbee

  • Guest
Re: Pagesettings (overview)
« Reply #7 on: September 02, 2011, 01:19:22 PM »
value = "" inside an input tag of type image can be a trap to run in an issuse.

Since version 1.5.3 Bakery provides a bugfix for IE, that takes car of that:
http://www.bakery-shop.ch/#version_153

Regards Christoph

jacobi22

  • Guest
Re: Pagesettings (overview)
« Reply #8 on: September 02, 2011, 05:55:17 PM »
I use CSS with the Original Code (no Image for Submit-Button inside the Code)

my CSS for the submit-Button
....
input[type=submit], input[type=reset] {
        background: #ffffff url(../img/submit_button.png) repeat-x;
        color: #000000;
}
input[type=submit]:hover, input[type=reset]:hover  {
        background: #ffffff url(../img/submit_button_on.png) repeat-x;
        color: #000000;
}
-----

Offline Shefra

  • Posts: 90
  • Gender: Male
Re: Pagesettings (overview)
« Reply #9 on: September 05, 2011, 09:24:23 AM »
Thanks for the answers. DarkViper your solution did it....

Thanks again.....