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?

hualingAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michel PlungjanIT ExpertCommented:
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ö
0
hualingAuthor Commented:
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 '

?

0
Michel PlungjanIT ExpertCommented:
try
\'

so
\'Button1\'

Michel

0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

hualingAuthor Commented:
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..)

0
Michel PlungjanIT ExpertCommented:
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
0
hualingAuthor Commented:
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?




0
Michel PlungjanIT ExpertCommented:
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
0
Michel PlungjanIT ExpertCommented:
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
0
hualingAuthor Commented:
Yahooo~~~~~~~~~~~~~~!!

Terrific~~~

My problem has solve after add "return false¡±

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

Thankss~~~
0
Michel PlungjanIT ExpertCommented:
Simple answer ;-)

Michel
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.