Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Image 2

Status
Not open for further replies.

perlTest

Programmer
Nov 16, 2002
14
0
0
US
I have an image called 'search_button.gif' and I want that image to act like a form and redirect it to 'search.cgi' just like using a <form action>. Anybody know how I can treat an image like form buttons? Thanks for reading.
 
Assuming you mean you want the image to function as a submit button on a form that 'search.cgi' is design to process:
<form action=&quot;search.cgi&quot; method=&quot;post&quot; name=&quot;dosomething&quot;>
...other input fields...
<input type=&quot;image&quot; src=&quot;search_button.gif&quot;>
</form>
 
I've found the image type to in some cases be some what restricting. you may also want to keep in mind that with the use of onClick=&quot;myForm.submit()&quot; you can make any object a submitable button for a form.

example:
<a href=&quot;&quot; onClick=&quot;myForm.submit()&quot;>submit form</a>
or
<a href=&quot;&quot; onClick=&quot;myForm.submit()&quot;><img src=&quot;image.gif&quot; width=&quot;10&quot; height=&quot;10&quot;></a>

and if you really want to have fun with your friends. use a input text with a onClick to submit the form :) ---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }
---------------------------------------
for the best results to your questions: FAQ333-2924

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top