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

INPUT type="image" causes "page-reset" ???

Status
Not open for further replies.

Dragonfish

Programmer
Apr 25, 2001
62
UG
I´m using a rollover-button to call a javascript function. Pressing the button does call the function (which writes text into a DIV area) but immediatly afterwards resets the page. Here´s the HTML-code:

<FORM>
<INPUT type=&quot;image&quot;
style=&quot;position: absolute; border: none; top: 13px; left: 198px; width: 15pt; height: 15pt;&quot;
src=&quot;./ttscwcurrentimages/button1-1.gif&quot;
name=&quot;Image3&quot;
alt=&quot;2. Herren&quot;
onClick=&quot;Herren_zwei()&quot;
onMouseOver=&quot;MM_swapImage('Image3','','./ttscwcurrentimages/button1-2.gif',1)&quot;
onMouseOut=&quot;MM_swapImgRestore()&quot;>
</FORM>

By simply changeing INPUT type=&quot;image&quot; to INPUT type=&quot;button&quot; the text gets written and stayes put but then I lose my rollover button. I´ve found no documentation on this &quot;reset-effect&quot;. I´ve tried using the button-tag but that messes up my rollover-button as well.

<BUTTON
style=&quot;position: absolute; border: none; top: 82px; left: 267px; width: 15pt; height: 15pt;&quot;
name=&quot;Image1&quot;
type=&quot;button&quot;
onClick=&quot;Home()&quot;
onMouseOver=&quot;MM_swapImage('Image1','','./ttscwcurrentimages/button1-2.gif',1)&quot;
onMouseOut=&quot;MM_swapImgRestore()&quot;>
<IMG src=&quot;./ttscwcurrentimages/button1-1.gif&quot; alt=&quot;Home&quot;>
</BUTTON>

Does anybody know how to prevent this INPUT type=&quot;image&quot; reset-effect. I can put this on the web if it helps to see what happens.

Thankxx DavidinGermany
david.gullever@web.de
 
Hi David,

Try to change your src=&quot;./ttscwcurrentimages/button1-1.gif&quot;

with 2 dots :

src=&quot;../ttscwcurrentimages/button1-1.gif&quot;

or if that doesn't work, write here the complete URL

Erik


<!-- My sport: Boomerang throwing !!
This year I will participate at the World Championships in Germany. (!! Many Happy Returns !! -->
 
Hi Erik,

it´s not the buttons, it´s what happens after the function they call is finnished - a reset. I´ve downloaded the W3C doc to find out exactly what happens - no luck.

On the other hand showing the buttond with the button-tag ???

DavidinGermany
david.gullever@web.de
 
Well I wouldnt use <button blablabla></button>
but instead I would use:

<input type=&quot;button&quot; blablabla> Everyone has a right to my opinion.
E-mail me at caswegkamp@hotmail.com

Heineken is like making love in a cano... it's f*cking close to water !!!
 
I´m afraid you´re missing the point. What I need is a rollover-button (and for that I need type=&quot;image&quot; - or at least I don´t know any other way of doing it) and a function that gets called without resetting the page/site.

Thankxx DavidinGermany
david.gullever@web.de
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top