Image Buttons

Chris Kelleher

Administrator
Staff member
Hi All,

Does anyone know how to pass the a value of Input type image button
within a mapped html file. I tried the " name and value"
options and they don't return a value when the button is selected. I'm
using Webspeed 2.1, progress 8.3B, WIN NT 4.0 sp4

Regards,

Andre

Andre Washington
Bac-Tech Systems, Inc. http://www.bac-tech.com
 

Chris Kelleher

Administrator
Staff member
Try this

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
&lt;input type="image" src="URL_of_image_file" ALT="Text_description" Align=""
USEMAP="map_name"&gt;
[/code]

If you want to dynamically set the image then try using the SRC.


Cameron David Wright
perotsystems
TDY @ TRW Automotive
 

Chris Kelleher

Administrator
Staff member
Hi,

I don't know exactly what you mean.
In this example "butValue" is the value that you have put for the "name"
attribute,
unfortunately, at the moment I don't have time to explain this all, but is
in any case something.

Put this in the definitions;

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
def var vbutton as char no-undo.
[/code]

In addition of this you can put your own definitions.
Make a new section, with the name NameOfTheSection, and put here something
like this;
What you do here is actually, telling what to do when a button is pressed
which value are passed,etc.

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
if Value3 &lt;&gt; "" then do:

IF get-value("butValue.x") ne "" THEN vbutton =
"AnyNameOrDescriYouWantToGiveThisImageButton".
ELSE IF get-value("butValue2.x") ne "" THEN vbutton =
"AnyNameOrDescriYouWantToGiveThisImageButton".
ELSE IF get-value("butValue3.x") ne "" THEN
DO:
vbutton = "PassedValue".
wkbutton2 = "PassedValue2".
END.

case vButton:
when "AnyNameOrDescriYouWantToGiveThisImageButton" then
do:
if AnyValue &lt;&gt; "ByExampleA_selectionListValue" then
do:
find first TableX where TableX.fieldX =
ByExampleA_selectionListValue no-lock no-error.
for each TableX2 of TableX no-lock by TableX2.FieldX2:
wklist = wklist + TableX2.FieldX2 + ",".

/* In this example "wklist" is the var. for a selection list, where the List
values are different 4 every action,
it tells actually where it should find the values, to fill it you need to
make another section, and after that you need to say before it do 'display
fields' in the process -web req.; Run SectionFillSelectionList*/

end.
FieldX2:list-items in frame {&FRAME-NAME} = wklist .
if ........
end.
when .......
/*Etcetera, etcetera........*/

end.
end case.
[/code]

Now, put something like this this in the Procedure Process-web-request:

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
IF REQUEST_METHOD = "POST":U THEN DO:

RUN TheNameThatYouGaveToTheSection.
if Value3 &lt;&gt; "" then
do:
if Value3 = "x" then Value3 = "".

RUN dispatch IN THIS-PROCEDURE ('display-fields':U).
RUN dispatch IN THIS-PROCEDURE ('enable-fields':U).
RUN dispatch IN THIS-PROCEDURE ('output-fields':U).

end.
[/code]

Hope it works,
Regards,

Sander Pham,
Casnet International

-------------------------------------------------
Complete Internet, eCommerce, Business-to-Business & multimedia solutions
provider
---
Pr. Kennedylaan 19
2517JK The Hague, The Netherlands
Phone: +31(0)703458343 Fax : +31(0)703107547
email: info@casnet.net www : http://www.casnet.net
 

Chris Kelleher

Administrator
Staff member
Hello,
input type=image buttons return a buttonname.x and buttonsname.y value
indicating where the user pressed the button. Try get-value("buttonname.x").
Regards,
Mike Fechner
 
Top