0

Hi,

When i clicked the submit button, it must be open an image and write a text like "Please wait". Then they will be hide after 5 seconds and we will see the submit button results. Can you help me about that?

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by Thirusha
0

Your question is very vague. Even though I do not really want to help you but it turned out to be quite an unexpected good exercise. A sample code is below...

<html>
<head>
<script type="text/javascript">
function displaySomething(aID, formID) {
  var el = document.getElementById(aID)
  if (el) {
    el.style.display = null
    el.style.visibility = null
    el.style.zIndex = 1
    el.style.opacity = 1
    window.setTimeout("hideSomething('"+aID+"','"+formID+"')", 5000) // 5 seconds
  }
}

// expect existence of aID && formID
function hideSomething(aID, formID) {
  var el = document.getElementById(aID)
  if (el.style.opacity>0) {  // fading effect
    el.style.opacity = (parseFloat(el.style.opacity)-0.2)
    window.setTimeout("hideSomething('"+aID+"','"+formID+"')", 120)
  }
  else {
    el.style.display = "none"
    el.style.visibility = "hidden"
    el.style.zIndex = 0
    document.getElementById(formID).submit()
    return false
  }
}
</script>
</head>

<body>
<form id='aForm'>
  <div id="stuffToShow" style="display:none;visibility;hide;position:absolute;top:100px;left:90px;font-size:32px;font-weight:bold;color:red;text-align:center;">
  Please WAIT!!!
  </div>
  <div style="border:2px solid gray;width:400px;height:300px;top:10px;text-align:center">
  <br /><br /><br /><br /><br /><br />
  ...Working Area...&nbsp;
  </div>
  <br />
  <input type="button" value="OK" onclick="displaySomething('stuffToShow', 'aForm')">
</form>
</body>
</html>
0

That is exactly what i want to do! Thanks man, thank you very much!

0
<input type="image" src="/button.gif" width="100" height="50"...

When i changed the button with image, it wasn't working. I will use image button. What can i do for this?

0

There is no such thing as

<input type="image" ...>

Change entire tag to and <img> tag something like this:

<img src="/button.gif" onclick="displaySomething('stuffToShow', 'aForm')">
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.