HighDots Forums  

Form button problem

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Form button problem in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
alwaysabitlost
 
Posts: n/a

Default Form button problem - 07-11-2004 , 10:24 AM






I'm trying to use an image for a submit button, the form submits the posted
data back to the same page. I'm using the following code for the image.

echo "<input type=\"image\" src=\"_images/addtobasket.gif\"
name=\"add_to_basket\" value=\"add_to_basket\">";

The trouble is the php that's supposed to handle the posted data is triggered
by an isset, and is looking for the value add_to_basket.

i.e.
if( isset($HTTP_POST_VARS["add_to_basket"]) )
{
echo "YUP GOT THE BALL!";
}

If I use the normal submit

echo "<input type=\"submit\" name=\"add_to_basket\" value=\"add_to_basket\">";

it works just fine.

Can anyone help me on this?

Thanks.


Reply With Quote
  #2  
Old   
Gary White
 
Posts: n/a

Default Re: Form button problem - 07-11-2004 , 12:00 PM






On Sun, 11 Jul 2004 14:24:49 +0000 (UTC), "alwaysabitlost"
<webforumsuser (AT) macromedia (DOT) com> wrote:

Quote:
if( isset($HTTP_POST_VARS["add_to_basket"]) )
{
echo "YUP GOT THE BALL!";
}

The value of an image field is not passed to the script. The x and y
coordinates of where you clicked the image are. I don't know exactly
what you're trying to accomplish, but this might work:

if( isset($HTTP_POST_VARS["add_to_basket_x"]) )


Gary


Reply With Quote
  #3  
Old   
alwaysabitlost
 
Posts: n/a

Default Re: Form button problem - 07-11-2004 , 01:12 PM



Gary, you're a superstar. I forgot php replaces periods with underscores when I tried that.

Thanks fella.

Reply With Quote
  #4  
Old   
Gary White
 
Posts: n/a

Default Re: Form button problem - 07-11-2004 , 07:28 PM



"alwaysabitlost" <webforumsuser (AT) macromedia (DOT) com>
wrote in message news:ccrsd7$e59$1 (AT) forums (DOT) macromedia.com...

Quote:
Gary, you're a superstar. I forgot php replaces periods
with underscores when I tried that.

Thanks fella.

You're welcome. Glad it helped.

Gary




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.