Jump to content


Photo

Message While Posting


  • Please log in to reply
2 replies to this topic

#1 scott.russell

scott.russell
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 08 June 2006 - 01:49 PM

I am having trouble getting getting a message to pop up while a page is posting to another page. I disabled the submit button when they click it and I need a message to pop up on the page that says Processing or something. Does anyone know a way to do this.

#2 SharkBait

SharkBait
  • Members
  • PipPipPip
  • Advanced Member
  • 845 posts
  • LocationMetro Vancouver, BC

Posted 08 June 2006 - 02:02 PM

I'm guessing it would have to be done with some sorta javascript when the button is pressed.

If ya google for javascript popups there should be a ton of examples. You'll just have to hook it on the OnClick for the submit button I suppose. Though I would not be sure how to close it when the page is done processing the request.... Might have to javascript that and when its done processing send a cmd or variables to the currently pop'd up window?



#3 micah1701

micah1701
  • Members
  • PipPipPip
  • Advanced Member
  • 613 posts
  • LocationEllington, CT USA

Posted 08 June 2006 - 02:08 PM

you want to use JavaScript and CSS - this should probably be moved to one of those forums.

create a css styled box containing your message and give it a z-index (layer) property on top of the rest of your page and also set it's display property to "none"

then, w/ javascript, onSubmit() when you are also getting rid of the button, change the display property back to "block" so it shows the box. whola!

something like this:
<script>
function message(){
document.getElementById('messageBox').style.display = 'block';
}
</script>

<style>
#messageBox{
z-index: 2;
display: none;
border: 1px #333333 solid;
padding: 5px;
}
</style>

<div id='messageBox'>
Please wait while your form is being submitted.
</div>

<form action="" method="post" onSubmit="message()">
<input type="submit" name="Submit" value="Submit">
</form>

"Confidence in the face of risk."




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users