Re: [PHP] FORM input type=image ... with a posting value

2001-04-08 Thread Victor Gamov

"Johnson, Kirk" wrote:
 
 Oops. You do need the type=image and src= attributes, instead of what I
 wrote in the example. Good thing it's Friday :)
 
  -Original Message-
  From: Johnson, Kirk
  Sent: Friday, April 06, 2001 1:29 PM
  To: [EMAIL PROTECTED]
  Subject: RE: [PHP] FORM input type=image ... with a posting value
 
 
  Yes, but you no longer check the value of "value" to
  determine which button
  was clicked. Instead, give each button a unique *name*
  attribute, then check
  if $name_x is set. The browser returns the x,y coordinates of
  the point
  where the user clicks the button, in variables named name_x
  and name_y.

To create unique name for many input type=image ... elements you can
use array

FORM method=post ...
input type=image name=images[1] ...
input type=image name=images[2] ...
input type=image name=images[3] ...
/FORM

and so on.  When you submit this form the $images array will be set and
sizeof($images) == 1.

-- 
CU, Victor Gamov

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] FORM input type=image ... with a posting value

2001-04-06 Thread Jared Howard

I have a page with multiple form submit buttons that carry different values
to do different functions and such.

form name="bidfile" method=post action="?=$ME?"
input type=submit name="mode" value="Edit Contacts"
input type=submit name="mode" value="Add Products"
input type=text name="something" value="?=$something?"
...
/form

?
switch (nvl($mode)) {
case "Edit Contacts" :
save_changes($HTTP_POST_VARS);
add_contact_info($bid_id);
break;
case "Add Products" :
save_changes($HTTP_POST_VARS);
add_bid_items($bid_id);
break;
...
}
?

Which works great!!  However, I grow tiresome of the typical button "look",
and in my attempt to use an image instead:

input type=image name="mode" value="Edit Contacts" src="contacts.png"

failed.  Is there a way to do this?  I have changed my stylesheet to have
the form inputs and whatnot to view smaller which I like.  But not small
enough in some instances, forcing me to look to other ways, such as an
image.  So as I asked before, is there a way to do this or any other
suggestions?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] FORM input type=image ... with a posting value

2001-04-06 Thread Johnson, Kirk

Yes, but you no longer check the value of "value" to determine which button
was clicked. Instead, give each button a unique *name* attribute, then check
if $name_x is set. The browser returns the x,y coordinates of the point
where the user clicks the button, in variables named name_x and name_y.

So,

input type=submit name="modeEdit" value="Edit Contacts"
input type=submit name="modeAdd" value="Add Products"

if($modeEdit_x)
  blah
elseif ($modeAdd_x)
  blah

Kirk

 -Original Message-
 From: Jared Howard [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 06, 2001 1:07 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] FORM input type=image ... with a posting value
 
 
 I have a page with multiple form submit buttons that carry 
 different values
 to do different functions and such.
 
 form name="bidfile" method=post action="?=$ME?"
 input type=submit name="mode" value="Edit Contacts"
 input type=submit name="mode" value="Add Products"
 input type=text name="something" value="?=$something?"
 ...
 /form

 Which works great!!  However, I grow tiresome of the typical 
 button "look",
 and in my attempt to use an image instead:
 
 input type=image name="mode" value="Edit Contacts" 
 src="contacts.png"
 
 failed.  Is there a way to do this?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] FORM input type=image ... with a posting value

2001-04-06 Thread Johnson, Kirk

Oops. You do need the type=image and src= attributes, instead of what I
wrote in the example. Good thing it's Friday :)

 -Original Message-
 From: Johnson, Kirk 
 Sent: Friday, April 06, 2001 1:29 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] FORM input type=image ... with a posting value
 
 
 Yes, but you no longer check the value of "value" to 
 determine which button
 was clicked. Instead, give each button a unique *name* 
 attribute, then check
 if $name_x is set. The browser returns the x,y coordinates of 
 the point
 where the user clicks the button, in variables named name_x 
 and name_y.
 
 So,
 
 input type=submit name="modeEdit" value="Edit Contacts"
 input type=submit name="modeAdd" value="Add Products"
 
 if($modeEdit_x)
   blah
 elseif ($modeAdd_x)
   blah
 
 Kirk
 
  -Original Message-
  From: Jared Howard [mailto:[EMAIL PROTECTED]]
  Sent: Friday, April 06, 2001 1:07 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] FORM input type=image ... with a posting value
  
  
  I have a page with multiple form submit buttons that carry 
  different values
  to do different functions and such.
  
  form name="bidfile" method=post action="?=$ME?"
  input type=submit name="mode" value="Edit Contacts"
  input type=submit name="mode" value="Add Products"
  input type=text name="something" value="?=$something?"
  ...
  /form
 
  Which works great!!  However, I grow tiresome of the typical 
  button "look",
  and in my attempt to use an image instead:
  
  input type=image name="mode" value="Edit Contacts" 
  src="contacts.png"
  
  failed.  Is there a way to do this?
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]