Kbase 16909: Using Image Form Elements and their Values
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
Using Image Form Elements and their Values
INTRODUCTION
============
This knowledgebase entry discusses using a form element
with input type of image to submit a form and the value
of this type of form element.
USING IMAGE FORM ELEMENT
========================
If you have a form element with an input type of
image you cannot get a value back to your web object.
For example, with the following HTML form element:
<INPUT TYPE="IMAGE" VALUE="image button pressed"
NAME="submit_image">
choosing the button will submit the form but no value
is passed back to the web object.
The following 4gl will return nothing in the field c_field:
run GetField IN web-utilities-hdl
("submit_image":U, output c_field).
ALTERNATE WAY OF GETTING VALUE
==============================
You could use the x coordinate of the image (which is the x
coordinate of the position in the image that the user clicked) to
determine if an image button has been chosen and set a value
based on that.
For example, two form elements of type image:
<INPUT TYPE="IMAGE" VALUE "image 1 pressed" NAME="submit_image1">
<INPUT TYPE="IMAGE" VALUE "image 2 pressed" NAME="submit_image2">
could be used with the following 4gl to determine which
image was chosen:
run GetField IN web-utilities-hdl
("submit_image1.x":U, output c_field).
run GetField IN web-utilities-hdl
("submit_image2.x":U, output d_field).
IF (c_field NE "" ) THEN
test_value = "image 1 pressed".
ELSE IF (d_field NE "") THEN
test_value = "image 2 pressed".
END.
{&OUT} test_value.
Progress Software Technical Support Note # 16909