Jump to content

Alert Box problem

- - - - -

  • Please log in to reply
7 replies to this topic

#1
hoku_2000 _99

hoku_2000 _99

    Learning Programmer

  • Members
  • PipPipPip
  • 67 posts
I have a working guestbook, but right now, say if you leave the captcha field empty, the alert box shows up correctly, but there is a horizontal grey area underneath the "Guestbook" header. I am trying to get rid of that and dont know how?

Here is my link.

http://starr05.comul...m/guestbook.php

#2
Vaielab

Vaielab

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 547 posts
What browser are you using?

#3
hoku_2000 _99

hoku_2000 _99

    Learning Programmer

  • Members
  • PipPipPip
  • 67 posts
IE 8.

#4
hoku_2000 _99

hoku_2000 _99

    Learning Programmer

  • Members
  • PipPipPip
  • 67 posts
Any ideas? I was thinking something along the times as to moving that section of code to another part of the page.

#5
Vaielab

Vaielab

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 547 posts
On the second page you display your error like so
<script language="javascript">

alert('You have not entered captcha or entered incorrect captcha!');

history.back();

</script>
An alert actually make the browser stop and wait for the user.
So everything before the alert is printed on the browser, and everythign after isn't
This is why you have the header, but nothing underneat it.

So you should either do the alert sooner, or do a different way to alert the user

#6
hoku_2000 _99

hoku_2000 _99

    Learning Programmer

  • Members
  • PipPipPip
  • 67 posts

Vaielab said:

On the second page you display your error like so
<script language="javascript">
alert('You have not entered captcha or entered incorrect captcha!');
history.back();
</script>
An alert actually make the browser stop and wait for the user.
So everything before the alert is printed on the browser, and everythign after isn't
This is why you have the header, but nothing underneat it.

So you should either do the alert sooner, or do a different way to alert the user


And that portion of the code goes in between the <head> correct?

#7
Vaielab

Vaielab

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 547 posts
This way you'll be redirected before anything showing on the page

#8
hoku_2000 _99

hoku_2000 _99

    Learning Programmer

  • Members
  • PipPipPip
  • 67 posts
Ok, got it. Thanks!




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users