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!

Why my preload images still do not display fast enough?

Status
Not open for further replies.

moepower

Programmer
Oct 5, 2000
93
US
I'm trying to code where there's an image of a Submit button, when clicked the button will change to Working and validate my page. I preloaded all the images ahead of time but when I clicked on the Submit button, the Submit image goes away but the Working image does not appear quick enough. A section of the code is below, please let me know what how I can do this. Thanks,

btw, I have to use type="image" for this page. Thanks,



<script>
.
.
submit = new Image();
submit.src = 'submit.gif';
working = new Image();
working.src = 'working.gif';

function validate(form,submitButton) {
if (working == false) {
image1.src=&quot;working.gif&quot;;
working = true;
theForm.modify.value=&quot;no&quot;;
return true;
} else {
return false;
}
</script>

<body>
.
.
<input type=&quot;image&quot; name=&quot;submitButton&quot; alt=&quot;Submit&quot; src=&quot;submit.gif&quot; border=0>
.
.
</body>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top