Jump to content

[SOLVED] Making a progress bar(image) visible onClick?


Solarpitch

Recommended Posts

Hey Guys,

 

I am using a "fake" progress bar for my form. Its just an animated gif. When the user hits submit I want to make the progress bar visible until the form has been submitted. Just wondering how I could achieve this? Something like...?

 

<input type="submit" name="Submit" value="Submit" onClick="return progress_bar(this);">

 

When submit is click I want to display "<img src="designs/pb_gap.gif" width="200" height="20">" just under it. When the for is submitted I want to hide the image again!

 

 

 

 

Link to comment
Share on other sites

do something like this.  the progress bar is already there but hidden by CSS.  then on submit, the javascript function hides the submit button and replaces it by un-hiding the progress image:

 

<script type="javascript">
function onSubmit(){
document.getElementById('submitButton').style.display = "none";
document.getElementById('progressBar').style.display = "block";
}
</script>

<form action="..." onSubmit="return onSubmit()">
  .....
<div id="submitButton">
<input type="button" value="submit">
</div>
<div id="progressBar" style="display: hidden">
<img src="yourProgressBar.gif">
</div>

</form>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.