anchor tag to submit a form

How do I get an anchor tag to submit a form?

this is what I have now....
                <input type="image" name="update" src="/images/go_button.jpg"
                    width="59" height="30">

instead I want this to submit the form...                    
                        <a href="/find.asp">
                            <img src="/template/images/Arrow2.png" border="0" />&nbsp;SEARCH</a>

How doI do that? thanks!
LVL 2
Starr DuskkASP.NET VB.NET DeveloperAsked:
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.

Ashish PatelCommented:
<a href="javascript:document.forms[0].action='find.asp';document.forms[0].submit();">
                            <img src="/template/images/Arrow2.png" border="0" />&nbsp;SEARCH</a>
0
almilyoCommented:
make sure you have a name in the form tag, so it looks something like

<form name="theform" >

And then write your link as

<a href="javascript:document.myform.submit();"><img src="/template/images/Arrow2.png" border="0" />&nbsp;SEARCH</a>
0
almilyoCommented:
sorry, that should have been

<a href="javascript:document.theform.submit();">

in my example.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
I must be doing something wrong. Here is my form:

<form name="searchForm" autocomplete="off" method="get" action="/find.asp">

                        <a href="javascript:document.searchForm.submit();">
                        <span>
                            <img src="/template/images/Arrow2.png" border="0" />&nbsp;SEARCH</span></a>

It submits to a page that doesn't exist:
/templatedefault.asp?

my path to this page is:
/template/default.asp
0
Ashish PatelCommented:
<form name="searchForm" autocomplete="off" method="post" action="/find.asp">
                        <a href="javascript:document.searchForm.action='/find.asp';document.searchForm.submit();">
                        <span>
                            <img src="/template/images/Arrow2.png" border="0" />&nbsp;SEARCH</span></a>
0
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
I just did that too....
<a href="javascript:document.searchForm.action='/find.asp';document.searchForm.submit();">

it does the same error.
0
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
oh wait. I see you are doing a "post" method and my code has a "get" method.

(existing code, trust me, I'd never do a "get"....)

Is that the problem?
0
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
No, switching to "post" doesn't do it either.
0
Ashish PatelCommented:
try re-changing it from post to get again
0
Ashish PatelCommented:
okay finally try this

<form name="searchForm" method="get" action="/find.asp">
                        <a href="javascript:void(0);" onClick="document.searchForm.action='/find.asp';document.searchForm.submit();">
                        <span>
                            <img src="/template/images/Arrow2.png" border="0" />&nbsp;SEARCH</span></a>
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
HTML

From novice to tech pro — start learning today.