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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, I am a fairly inexperienced jav

Status
Not open for further replies.

frenchtaquito

Technical User
Apr 5, 2001
56
US
Hi, I am a fairly inexperienced javascript user. I got this script from a free script site and it is almost what I need except that I would like to use an image(my own button) instead of the "go" button to activate it. (The script lets someone type in a url and the button submits it).
Can anyone help me with this?
Thanks in advance!
Ginger



Here is the script-

<form name=&quot;jumpurl1&quot; onSubmit=&quot;return jumpit()&quot;>
<input type=&quot;text&quot; size=30 name=&quot;jumpurl2&quot; value=&quot;<input type=&quot;button&quot; value=&quot;Go!&quot; onClick=&quot;jumpit()&quot;>
</form>
<script>

/*
URL jump box
By JavaScript Kit (Over 200+ free scripts here!
*/

function jumpit(){
window.location=document.jumpurl1.jumpurl2.value
return false
}
</script>

<p align=&quot;center&quot;><font face=&quot;arial&quot; size=&quot;-2&quot;>This free script provided by</font><br>
<font face=&quot;arial, helvetica&quot; size=&quot;-2&quot;><a href=&quot;Kit</a></font></p>
 
Hi

Replace the line:

<input type=&quot;button&quot; value=&quot;Go!&quot; onClick=&quot;jumpit()&quot;>

With:

<img src=&quot;button.gif&quot; onClick=&quot;jumpit()&quot;>

Cheers,
Richard
(Johannesburg, South Africa)
 
It's very simple.
instead of this string:
<input type=&quot;button&quot; value=&quot;Go!&quot; onClick=&quot;jumpit()&quot;>

you have to write this:
<a href=&quot;#&quot; onclick=&quot;jumpit()&quot;><img src=&quot;something.gif&quot; border=&quot;0&quot; width=&quot;&quot; height=&quot;&quot; alt=&quot;Click to go there&quot; title=&quot;Click to go there&quot;></a>

Replace image name with the one you have and add it's dimentions, and that's all.

good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top