Start New Discussion within our Web Development Community

Hey guys i have a little problem!! :confused:

I am trying to prompt a JavaScript alert before the html headers and when this happens i does not style my footer from css.

Heres my code:

if ($queryupdate) { echo "<script>alert('Your password has been updated!')</script>"; } else { echo "<script>alert('Your password has not updated!')</script>"; }

Does any body know how this can be fixed?

Thanks,
Marais

It worked for me.
Try this:

if ($queryupdate) {
    echo "<script type=\"text/javascript\">alert('Your password has been updated!')</script>";
} else {
    echo "<script type=\"text/javascript\">alert('Your password has been updated!')</script>";
}

Check $queryupdate's value.

Fist... do this...

if ($queryupdate) {
    echo "<script type='text/javascript'>alert('Your password has been updated!')</script>";
    } else {
    echo "<script type='text/javascript'>alert('Your password has been updated!')</script>";
    }

And then, maybe, it won't be styled because first run alert and all stop...

thanks, so will this work before the html headers??

And then still style??

Thanks,
Marais

I mean, when alert is prompted, all stop processing until you press ok or what you have to press...

This article has been dead for over six months. Start a new discussion instead.