Link to home
Start Free TrialLog in
Avatar of hualing
hualing

asked on

htp.formImage in Oracle PL/SQL

Dear you,
I want to let my button show as a Image so My HTML should be:

<input type="image" ... >
instead of <input type="submit" ...>
in PL/SQL , we can use htp.formImage to
generate this.

But When I submit, I can not get the name and value of the button:(

What can I do?

Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

How about this:
<FORM NAME="myForm">
<INPUT TYPE="hidden" NAME="whatBut" VALUE="">
..
..
..
</FORM>
<A HREF="javascript:;"
onClick="document.myForm.whatBut.value='Button1'; document.myForm.submit()"><IMG SRC="but1.gif" BORDER=0"></A>

<A HREF="javascript:;"
onClick="document.myForm.whatBut.value='Button2'; document.myForm.submit()"><IMG SRC="but2.gif" BORDER=0"></A>

Micheö
Avatar of hualing
hualing

ASKER

Dear Michel ,
Nice to meet you ~

I have to put the <a ..></a> into htp.print('');

but the string inclue'
how to transferr the  meaning of '

?

try
\'

so
\'Button1\'

Michel

Avatar of hualing

ASKER

my code:

 htp.print('<A HREF="javascript:;" onClick="document.myForm.whatBut.value=\' O  K \'; document.myForm.submit()"><IMG SRC="http://sichuan/images/ok.gif" BORDER=0"></A>');

show errors:
287/79   PLS-00103: Encountered the symbol "O" when expecting one of the
         following:
         . ( ) , * @ % & | = - + < / > in mod not range rem => ..
         an exponent (**) <> or != or ~= >= <= <> and or like between
         using is null is not || is dangling

(p.s. my code is line 287..)

I am sorry I have no idea.

For the time being do this:
htp.print('<script>OK = "OK";</script>');
htp.print('<A HREF="javascript:;"
                                    onClick="document.myForm.whatBut.value=OK;document.myFormsubmit()">Go</A>');

Michel
Avatar of hualing

ASKER

Good idea,
My code now as below:"
htp.print('<script>OK=" O  K ";QUERY=" Query ";LIST=" List "</script>');
  htp.print('<a href="#" onClick="document.forms[0].b_submit.value=OK;document.forms[0].submit();"><img src="http://sichuan/images/ok.gif" border=0></a>');

============================

it is working in Netscape

if i change to "HREF="javascript:;"
it has no reponse in both IE and NN

why?




Hmm - it should actually be

htp.print('<a href="javascript:;" onClick="document.forms[0].b_submit.value=OK;document.forms[0].submit();return false"><img src="http://sichuan/images/ok.gif" border=0></a>'

OR if the target is current page, you can just use

htp.print('<a href="javascript:document.forms[0].b_submit.value=OK;document.forms[0].submit();"><img src="http://sichuan/images/ok.gif" border=0></a>'

Michel
PS: if the target is current page, then it does not really matter if you use # since you leave the page anyway.
The javascript:; and return false are for links that change other pages than the one with the link

Michel
Avatar of hualing

ASKER

Yahooo~~~~~~~~~~~~~~!!

Terrific~~~

My problem has solve after add "return false¡±

Please make a simple answer ,and i will give you my points!

Thankss~~~
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial