vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Alert Error Popups (https://vborg.vbsupport.ru/showthread.php?t=163491)

Our House 11-24-2007 07:44 AM

Alert Error Popups
 
Hi All,

Several of my forms use error-checking. At the moment, I use the following PHP function to create Javascript Alert errors and call it whenever information is filled in incorrectly:

Code:

function AlertError($message)
{
        print("<script language='Javascript'>alert('" . $message . "')</script>");
}


The above function gets executed with 'submit' buttons and works like it should when an error is detected. However, it displays the alert error over a new (blank white) page and then reverts back to the old page after the user hits 'OK'. It's pretty ugly-looking.

What I want it to do is the same thing that vB Alert Errors do (see screenshot below).

http://img256.imageshack.us/img256/5...messagels6.png

I deal entirely with PHP and HTML when working on my forum. I know absolutely nothing about AJAX or Javascript.

What is the easiest way to make this Alert function pop up over the existing page without actually submitting the form?

Thank You,
OH

ZomgStuff 11-24-2007 01:24 PM

Isn't this a default feature of vBulletin?

Our House 11-27-2007 08:44 AM

Quote:

Originally Posted by ZomgStuff (Post 1388613)
Isn't this a default feature of vBulletin?

It is, but only for vBulletin's error messages, not my own.

Anyone have any suggestions?


All times are GMT. The time now is 09:44 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01185 seconds
  • Memory Usage 1,711KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete