Anchor tag question

I have a form with two input fields and 5 anchored GIFs for buttons.  Each GIF will send me to a different URL.  I want to transfer the data within the fields in the first screen to the new URL when I press the GIF button.  How can I accomplish this?
bkeithmAsked:
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.

knightEknightCommented:
Try this:

<A href='#' onClick='document.myform.action="URL1.htm";document.myform.submit();return(false);'><IMG src='img1.gif' border='0'></a>

<A href='#' onClick='document.myform.action="URL2.htm";document.myform.submit();return(false);'><IMG src='img2.gif' border='0'></a>

<A href='#' onClick='document.myform.action="URL3.htm";document.myform.submit();return(false);'><IMG src='img3.gif' border='0'></a>

etc

____________________________________________________________________________________________________________________________________
0
Jan LouwerensSoftware EngineerCommented:
even better than <a href="#"...> would be to use <a href="javascript:void()"...> because it won't jump to the top of the page when you click it...
0
knightEknightCommented:
... that is why I return false in the onClick -- so that it won't jump.  Therefore, '#' is no worse than 'javascript:void();'  or even 'javascript:;'
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!

Jan LouwerensSoftware EngineerCommented:
I did not know that! You learn something new everyday, huh? Thanks for the new knowledge, knightEknight  =)
0
knightEknightCommented:
Yep!  That is the purpose of returning true or false from an anchor.  You could even use href='cnn.com' and as long as you return false, you will never actually go to cnn.com .  It also allows you to do things like this:

<A href='www.cnn.com' onClick='return(confirm("Are you sure?"));'>Click Me!</a>
0
bkeithmAuthor Commented:
Thanks knightEknight.  The points are yours. Sorry about the tardiness of the acceptance.  I've been out-ot-pocket for a few days.  
0
knightEknightCommented:
Glad to help!
0
knightEknightCommented:
<A href='#' onClick='document.myform.action="URL1.htm";document.myform.submit();return(false);'><IMG src='img1.gif' border='0'></a>

<A href='#' onClick='document.myform.action="URL2.htm";document.myform.submit();return(false);'><IMG src='img2.gif' border='0'></a>

<A href='#' onClick='document.myform.action="URL3.htm";document.myform.submit();return(false);'><IMG src='img3.gif' border='0'></a>

etc
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.