English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hi, I have a website with following html is working on all browser except Safari. I need to use another method to hide and disable the submit image after a user clicked on it. I don't know too much about JS, I have to fix it ASAP.. Thanks in advance.













2007-02-26 17:28:33 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

innerhtml is a crutch for the weak! Real programmers use the dom attributes to change an image src.

by giving an ID to the img itself you can quickly and easily get at it with
document.getElementByID('imgName').src = 'newPix.gif'

you can also add a class or change the height of an existing image to make it appear while submitting!

although innerhtml seems like a good idea, it was not a part of the w3c standards... so the Safari team decided not to do it like the other players had already implemented it.


and to the previous poster.. there is no name attribute for an image tag... it's id! Name only works in IE!

2007-02-27 06:26:49 · answer #1 · answered by jake cigar™ is retired 7 · 0 0

You need to change the code:-
document.f.submitimage.innerHTML = "";

to:-
document.images[submitImage].src = "wait.gif";
That is:-
document. images[submitImage]. src = "wait.gif";
But without spaces in the middle.

You also need to change :-


to:-


This should work for all browsers.

2007-02-26 20:48:01 · answer #2 · answered by AnalProgrammer 7 · 0 1

fedest.com, questions and answers