Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

overlibmws · DHTML Tooltip and Sticky Popup Library

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 306
  • Category: JavaScript
  • Founded: Apr 19, 2004
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 574 - 603 of 1492   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#574 From: "docdudeus" <docdudeus@...>
Date: Tue Jan 3, 2006 7:53 pm
Subject: passing php generated error messages to overlib
docdudeus
Send Email Send Email
 
Hi,
I'm looking to pass any error messages generated in our php login
script to an overlib popup at the time of submitting the html form
data to that same script. Presently a separate page will open that
lists the errors generated by the login script. I would like to have a
bubble popup or image popup open, anchor it to an absolute area on the
screen where the login process (i.e. username entry, etc.) occurs, and
inform the user of any error encountered in the login process. The
present scripts work but generate error messages on a separate page.

This is the test script I've used which includes the form that passes
the username and password to the login verification script.

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>here</title>
<script type="text/javascript" src="overlibmws.js"></script>
<script type="text/javascript" src="overlibmws_bubble.js"></script>
<script type="text/javascript" src="overlibmws_filter.js"></script>
<script type="text/javascript" src="iframecontentmws.js"></script>
<script type="text/javascript" src="overlibmws_iframe.js"></script>
<script type="text/javascript" src="overlibmws_overtwo.js"></script>
<script type="text/javascript" src="overlibmws_scroll.js"></script>
<script type="text/javascript" src="overlibmws_draggable.js"></script>
</head>
<body>
<form action="logintest.php" onsubmit="return overlib('php error
value', TEXTCOLOR, '#000000', TEXTSIZE, 2, WIDTH, 170, HEIGHT, 120,
BACKGROUND,'images/bubble.gif',PADX, 60, 20, PADY, 20, 20);"
onmouseout="nd();" method="post">
<div style="margin-left: 100px; padding-bottom: 10px;">
<input type="Text" name="username" value="USERNAME" size="15"><br>
<input type="password" name="password" value="PASSWORD"
size="13">  
<input type="image" src="images/b_go.jpg" value="submit" width="23"
height="27">
<!--<bubble test>-->
<a href="javascript:void(0);" onclick="return overlib('This is an
<b>oval</b> bubble popup.', BUBBLE,BUBBLETYPE, 'oval',
ADJBUBBLE, TEXTSIZE, 1, FILTER,
FILTERSHADOW,1,FILTERSHADOWCOLOR,'purple');" onmouseout="nd();"><input
type="image" src="images/b_go.jpg" value="submit" alt="submit"
hspace="10" align="absbottom" border="0" width="23" height="24"></a></div>

<!--<iframe test>-->
<a href=javascript:void(0);
onclick="return overlib(
OLiframeContent('logintest.php', 510, 145, 'if1', 1),
WRAP, TEXTPADDING,0, BORDER,2, STICKY, CAPTIONPADDING,4,
MIDX,0, RELY,90,STATUS);"
onmouseout="nd();"><input type="image" src="images/b_go.jpg"
value="submit" alt="submit" width="23" height="27"></a>
<p> </p>
</form>
</body>
</html>

This is the php login verification script:


// Declare loginError so a value is always available
$loginError = "";
// Enable sessions
include_once "session.php";
require ("getipnew.php");
// Turn on magic quotes to prevent SQL injection attacks
if(!get_magic_quotes_gpc())
set_magic_quotes_runtime(1);
// Connect to database
$eg_objConn2 = mysql_connect("hostname", "dbname", "password");
mysql_select_db("dbname", $eg_objConn2);
//Set login variables

$t = time();
$datetime = date("m-d-Y h:i A", $t);
$lastlogin = date("m-d-Y");
$lasttime = date("h:i A");
$ip_address = getip();
$http_user = $_SERVER['HTTP_USER_AGENT'];

// Validate users input
if(!empty($_POST))
{
// Check username has a value
if(empty($_POST['username'])) $eg_error['username'] = "Please enter a
user name!";
// Check password has a value
if(empty($_POST['password'])) $eg_error['password'] = "Please enter a
password!";
// Check if any errors were returned and run relevant code
if(empty($eg_error))
{
// Get allusers Record Set
$eg_recResult1 = mysql_query("SELECT
`allusers`.`egnID`,`allusers`.`username` FROM `allusers` WHERE
`allusers`.`username` = '".@$_POST['username']."' AND
`allusers`.`passwrd` = '".@$_POST['password']."'", $eg_objConn2);
$eg_Result1 = @mysql_fetch_array($eg_recResult1, MYSQL_ASSOC);
// Get online_regs Record Set
$eg_recResult2 = mysql_query("SELECT
`online_regs`.`egnID`,`online_regs`.`username` FROM `online_regs`
WHERE `online_regs`.`username` = '".@$_POST['username']."' AND
`online_regs`.`passwrd` = '".@$_POST['password']."'", $eg_objConn2);
$eg_Result2 = @mysql_fetch_array($eg_recResult2, MYSQL_ASSOC);
// Conditional statement
if(!empty($eg_Result1['egnID']))
{
// Set Session Value
$_SESSION['loggedInUserID'] = @$eg_Result1['egnID'];

$_SESSION['loggedInUsername'] = @$eg_Result1['username'];
// adds 1 to the users "logincount" in the users table. that way
you see how many times a person has logged in
mysql_query("UPDATE allusers SET logincount = logincount+1 , online
= 'yes' , lastlogin = '$lastlogin' , lasttimelogin = '$lasttime' ,
Remote_computer_name = '$ip_address' , Browser_type = '$http_user' ,
Timestamp = '$datetime' WHERE (username = '".@$_POST['username']."')")
or die("Bad query: ".mysql_error());
// inserting login information, 1 = correct login
$insert = "INSERT INTO logins(timestamp, ip_address, username,
password, correct, incorrect) ".
"VALUES('$datetime', '$ip_address', '".@$_POST['username']."',
'".@$_POST['password']."', '1', '0')"
or die("Bad query: ".mysql_error());
$mysql_insert = mysql_query($insert)
or die("Bad query: ".mysql_error());
// Go to page
header("Location: membersmain.php?login=successful");
exit;
}
elseif(!empty($eg_Result2['egnID']))
{
// Set Session Value
$_SESSION['loggedInUserID'] = @$eg_Result2['egnID'];

$_SESSION['loggedInUsername'] = @$eg_Result2['username'];
// Go to page
header("Location: newuserinfo.php");
exit;
}

{
$loginError = "Your user name and password do not match any in our
database!";
// inserting login information, 0 = incorrect login
$insert = "INSERT INTO logins (timestamp, ip_address, username,
password, correct, incorrect) ".
"VALUES ('$datetime', '$ip_address', '".@$_POST['username']."',
'".@$_POST['password']."', '0', '1') "
or die("Bad query: ".mysql_error());
$mysql_insert = mysql_query($insert)
or die("Please notify the admin that the script is connecting to
the database, but not inserting the information<br><br>
".pg_errormessage());
}
}
}

?>


<?
// Loop through all errors
if(!empty($eg_error))
{
?>
<ul>
<?
foreach($eg_error as $eg_message)
{
?>
<li id="validationError"><?= @$eg_message ?></li>
<?
}
?>
</ul>
<?
}

?>
<strong><font color="red"><p id="loginError" align="center"><?=
$loginError ?></p></font></strong>
</div>
<p class="bot" style="margin-bottom: -5px; margin-left: 40px;">
<?
// Tidy up used objects
// Close Main recordset
if(isset($eg_recResult1)) @mysql_free_result($eg_recResult1);
// Close Online Registration recordset
if(isset($eg_recResult2)) @mysql_free_result($eg_recResult2);

// Close database connection
if(isset($eg_objConn2)) @mysql_close($eg_objConn2);

?>

The variables I'd like to pass to overlib are $loginError and
$eg_message.

Any input would be appreciated!
John

#575 From: "Foteos Macrides" <fote@...>
Date: Wed Jan 4, 2006 10:38 pm
Subject: Re: [OLmws] passing php generated error messages to overlib
oldgreeky
Send Email Send Email
 
John,
 
You cannot use the onsubmit event in the initial document to display the error message because the form submission must be received by your server and analyzed by its form handler (i.e., by your "login verification script") before any error could be detected and an error message generated.
 
A common way of handling the login error is to have your verification script return a version of the initial document with the values for the form's input fields replaced by what the user entered, and a message added about the error.  If you place the error message in a popup invoked via the onload event, you more or less create the illusion that the popup has been added to the initial document, but it is actually the second, "form reply" document.
 
So what you presently are trying to do via the onsubmit attribute in the form start tag should instead be done via an onload attribute in the body start tag.  For positioning of the popup, you can assign an id to the form start tag or to one of the input tags, and in the overlib call via the onload attribute use the REF command with that id as its parameter.  You can use REFC, REFP, REFX, and/or REFY for optimum positioning of the popup.  See the:
 
 
support document for more information about REFerence-based positioning.
 
Fote
--
 
----- Original Message -----
From: docdudeus
Sent: Tuesday, January 03, 2006 2:53 PM
Subject: [OLmws] passing php generated error messages to overlib

Hi,
I'm looking to pass any error messages generated in our php login script to an overlib popup at the time of submitting the html form data to that same script. Presently a separate page will open that lists the errors generated by the login script. I would like to have a bubble popup or image popup open, anchor it to an absolute area on the screen where the login process (i.e. username entry, etc.) occurs, and inform the user of any error encountered in the login process. The present scripts work but generate error messages on a separate page.

This is the test script I've used which includes the form that passes the username and password to the login verification script.

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>here</title>
<script type="text/javascript" src="overlibmws.js"></script>
<script type="text/javascript" src="overlibmws_bubble.js"></script>
<script type="text/javascript" src="overlibmws_filter.js"></script>
<script type="text/javascript" src="iframecontentmws.js"></script>
<script type="text/javascript" src="overlibmws_iframe.js"></script>
<script type="text/javascript" src="overlibmws_overtwo.js"></script>
<script type="text/javascript" src="overlibmws_scroll.js"></script>
<script type="text/javascript" src="overlibmws_draggable.js"></script>
</head>
<body>
<form action="logintest.php" onsubmit="return overlib('php error value', TEXTCOLOR,'#000000', TEXTSIZE,2, WIDTH,170, HEIGHT,120, BACKGROUND,'images/bubble.gif', PADX,60,20, PADY,20,20);"
onmouseout="nd();" method="post">
<div style="margin-left: 100px; padding-bottom: 10px;">
<input type="Text" name="username" value="USERNAME" size="15"><br>
<input type="password" name="password" value="PASSWORD"
size="13">&nbsp;&nbsp;
<input type="image" src="images/b_go.jpg" value="submit" width="23"
height="27">
<!--<bubble test>-->
<a href="javascript:void(0);" onclick="return overlib('This is an &lt;b&gt;oval&lt;/b&gt; bubble popup.', BUBBLE, BUBBLETYPE, 'oval', ADJBUBBLE, TEXTSIZE,1, FILTER, FILTERSHADOW,1, FILTERSHADOWCOLOR,'purple');" onmouseout="nd();"><input type="image" src="images/b_go.jpg" value="submit" alt="submit" hspace="10" align="absbottom" border="0" width="23" height="24"></a></div>

<!--<iframe test>-->
<a href=javascript:void(0);
onclick="return overlib(OLiframeContent('logintest.php', 510, 145, 'if1', 1), WRAP, TEXTPADDING,0, BORDER,2, STICKY, CAPTIONPADDING,4, MIDX,0, RELY,90, STATUS);"
onmouseout="nd();"><input type="image" src="images/b_go.jpg" value="submit" alt="submit" width="23" height="27"></a>
<p>&nbsp;</p>
</form>
</body>
</html>

This is the php login verification script:


// Declare loginError so a value is always available
$loginError = "";
// Enable sessions
include_once "session.php";
require ("getipnew.php");
// Turn on magic quotes to prevent SQL injection attacks
if(!get_magic_quotes_gpc())
set_magic_quotes_runtime(1);
// Connect to database
$eg_objConn2 = mysql_connect("hostname", "dbname", "password");
mysql_select_db("dbname", $eg_objConn2);
//Set login variables

$t = time();
$datetime = date("m-d-Y h:i A", $t);
$lastlogin = date("m-d-Y");
$lasttime = date("h:i A");
$ip_address = getip();
$http_user = $_SERVER['HTTP_USER_AGENT'];

// Validate users input
if(!empty($_POST))
{
// Check username has a value
if(empty($_POST['username'])) $eg_error['username'] = "Please enter a
user name!";
// Check password has a value
if(empty($_POST['password'])) $eg_error['password'] = "Please enter a
password!";
// Check if any errors were returned and run relevant code
if(empty($eg_error))
{
// Get allusers Record Set
$eg_recResult1 = mysql_query("SELECT
`allusers`.`egnID`,`allusers`.`username` FROM `allusers` WHERE
`allusers`.`username` = '".@$_POST['username']."' AND
`allusers`.`passwrd` = '".@$_POST['password']."'", $eg_objConn2);
$eg_Result1 = @mysql_fetch_array($eg_recResult1, MYSQL_ASSOC);
// Get online_regs Record Set
$eg_recResult2 = mysql_query("SELECT
`online_regs`.`egnID`,`online_regs`.`username` FROM `online_regs`
WHERE `online_regs`.`username` = '".@$_POST['username']."' AND
`online_regs`.`passwrd` = '".@$_POST['password']."'", $eg_objConn2);
$eg_Result2 = @mysql_fetch_array($eg_recResult2, MYSQL_ASSOC);
// Conditional statement
if(!empty($eg_Result1['egnID']))
{
// Set Session Value
$_SESSION['loggedInUserID'] = @$eg_Result1['egnID'];

$_SESSION['loggedInUsername'] = @$eg_Result1['username'];
// adds 1 to the users "logincount" in the users table. that way
you see how many times a person has logged in
mysql_query("UPDATE allusers SET logincount = logincount+1 , online
= 'yes' , lastlogin = '$lastlogin' , lasttimelogin = '$lasttime' ,
Remote_computer_name = '$ip_address' , Browser_type = '$http_user' ,
Timestamp = '$datetime' WHERE (username = '".@$_POST['username']."')")
or die("Bad query: ".mysql_error());
// inserting login information, 1 = correct login
$insert = "INSERT INTO logins(timestamp, ip_address, username,
password, correct, incorrect) ".
"VALUES('$datetime', '$ip_address', '".@$_POST['username']."',
'".@$_POST['password']."', '1', '0')"
or die("Bad query: ".mysql_error());
$mysql_insert = mysql_query($insert)
or die("Bad query: ".mysql_error());
// Go to page
header("Location: membersmain.php?login=successful");
exit;
}
elseif(!empty($eg_Result2['egnID']))
{
// Set Session Value
$_SESSION['loggedInUserID'] = @$eg_Result2['egnID'];

$_SESSION['loggedInUsername'] = @$eg_Result2['username'];
// Go to page
header("Location: newuserinfo.php");
exit;
}

{
$loginError = "Your user name and password do not match any in our
database!";
// inserting login information, 0 = incorrect login
$insert = "INSERT INTO logins (timestamp, ip_address, username,
password, correct, incorrect) ".
"VALUES ('$datetime', '$ip_address', '".@$_POST['username']."',
'".@$_POST['password']."', '0', '1') "
or die("Bad query: ".mysql_error());
$mysql_insert = mysql_query($insert)
or die("Please notify the admin that the script is connecting to
the database, but not inserting the information<br><br>
".pg_errormessage());
}
}
}

?>


<?
// Loop through all errors
if(!empty($eg_error))
{
?>
<ul>
<?
foreach($eg_error as $eg_message)
{
?>
<li id="validationError"><?= @$eg_message ?></li>
<?
}
?>
</ul>
<?
}

?>
<strong><font color="red"><p id="loginError" align="center"><?=
$loginError ?></p></font></strong>
</div>
<p class="bot" style="margin-bottom: -5px; margin-left: 40px;">
<?
// Tidy up used objects
// Close Main recordset
if(isset($eg_recResult1)) @mysql_free_result($eg_recResult1);
// Close Online Registration recordset
if(isset($eg_recResult2)) @mysql_free_result($eg_recResult2);

// Close database connection
if(isset($eg_objConn2)) @mysql_close($eg_objConn2);

?>

The variables I'd like to pass to overlib are $loginError and
$eg_message.

Any input would be appreciated!
John

#576 From: "docdudeus" <docdudeus@...>
Date: Fri Jan 6, 2006 2:47 am
Subject: Re: [OLmws] passing php generated error messages to overlib
docdudeus
Send Email Send Email
 
Fote,
Thanks for the help.  I tried that trick using iframes (no overlib)
but even with margins and borders set to "0" I still had a 1 pixel
area around the embedded iframe!!  I guess the htmlentities() and
other php functions won't be helpful.  I was looking for a cleaner way
to pass the error messages.
Efaristo.


--- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...> wrote:
>
> John,
>
> You cannot use the onsubmit event in the initial document to display
the error message because the form submission must be received by your
server and analyzed by its form handler (i.e., by your "login
verification script") before any error could be detected and an error
message generated.
>
> A common way of handling the login error is to have your
verification script return a version of the initial document with the
values for the form's input fields replaced by what the user entered,
and a message added about the error.  If you place the error message
in a popup invoked via the onload event, you more or less create the
illusion that the popup has been added to the initial document, but it
is actually the second, "form reply" document.
>
> So what you presently are trying to do via the onsubmit attribute in
the form start tag should instead be done via an onload attribute in
the body start tag.  For positioning of the popup, you can assign an
id to the form start tag or to one of the input tags, and in the
overlib call via the onload attribute use the REF command with that id
as its parameter.  You can use REFC, REFP, REFX, and/or REFY for
optimum positioning of the popup.  See the:
>
> http://www.macridesweb.com/oltest/REF.html
>
> support document for more information about REFerence-based positioning.
>
> Fote
> --
>

#577 From: "docdudeus" <docdudeus@...>
Date: Fri Jan 6, 2006 7:20 am
Subject: Re: [OLmws] passing php generated error messages to overlib
docdudeus
Send Email Send Email
 
Fote,
Cool I got it working.  I made an exact copy of the HTML markup and
placed it in the login verification script.  Using the onload= event
in the body tag I added the overlib function with the load argument
being a php looping command that calls out the error array holding any
error messages generated by the verification script. Probably could
have setup a Javascript function to make it easier to follow but I'm
not proficient in Javascript.
The only problem now is trivial.
If you look at the URL http://www.jeffexes.com/newtemplate in the
status area you'll notice (I set the AUTOSTATUS command in overlib)
the html list tags as well as the array values being listed.
Also when I use ADJBUBBLE command, for some reason it wraps the first
line of returned text. As it is now I've removed the ADJBUBBLE command
to circumvent this problem.

Any suggestions?

Very Cool, BTW!!




--- In overlibmws@yahoogroups.com, "docdudeus" <docdudeus@y...> wrote:
>
> Fote,
> Thanks for the help.  I tried that trick using iframes (no overlib)
> but even with margins and borders set to "0" I still had a 1 pixel
> area around the embedded iframe!!  I guess the htmlentities() and
> other php functions won't be helpful.  I was looking for a cleaner way
> to pass the error messages.
> Efaristo.
>
>
> --- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...> wrote:
> >
> > John,
> >
> > You cannot use the onsubmit event in the initial document to display
> the error message because the form submission must be received by your
> server and analyzed by its form handler (i.e., by your "login
> verification script") before any error could be detected and an error
> message generated.
> >
> > A common way of handling the login error is to have your
> verification script return a version of the initial document with the
> values for the form's input fields replaced by what the user entered,
> and a message added about the error.  If you place the error message
> in a popup invoked via the onload event, you more or less create the
> illusion that the popup has been added to the initial document, but it
> is actually the second, "form reply" document.
> >
> > So what you presently are trying to do via the onsubmit attribute in
> the form start tag should instead be done via an onload attribute in
> the body start tag.  For positioning of the popup, you can assign an
> id to the form start tag or to one of the input tags, and in the
> overlib call via the onload attribute use the REF command with that id
> as its parameter.  You can use REFC, REFP, REFX, and/or REFY for
> optimum positioning of the popup.  See the:
> >
> > http://www.macridesweb.com/oltest/REF.html
> >
> > support document for more information about REFerence-based
positioning.
> >
> > Fote
> > --
> >
>

#578 From: "Foteos Macrides" <fote@...>
Date: Fri Jan 6, 2006 6:46 pm
Subject: Re: [OLmws] passing php generated error messages to overlib
oldgreeky
Send Email Send Email
 
Efaristo,
 
The code for the ADJBUBBLE feature was designed for BUBBLE popup content which is plain text or is HTML with only inline markup.  If you use block-level markup in the content, such as UL and LI in your case, that can impose its own line breaks and formatting which may not be taken into account by the ADJBUBBLE code.  So in that case it is better to omit ADJBUBBLE, as you have done.
 
The AUTOSTATUS command sends the popup's main content to the status line, but browsers do not render statusline content, so if it contains HTML markup you see that as literal.  In your case, you can use STATUS and make its parameter the same as the overlib call's lead argument but without the encasing HTML markup. 
 
Note that your login verification script is creating two separate onload="js_function();" pairs in the body start tag.  To work reliably across all of the supported browsers, the two javascript function calls should be concatenated so that you have only one onload attribute:
 
onload="overlib(...); preloadImages();"
 
Also note that you are importing the overlibmws_regCore.js plugin module unnecessarily.  That plugin is for any frames or iframes which do not themselves import the overlibmws.js core module but instead use one imported by another frame or the parent.
 
Finally, I had neglected to indicate that popups invoked via onload should be STICKY.  You presently are not including that command in the overlib call, and have placed onmouseout="nd()" in the body start tag.  The latter event is not supported in a rational way by browsers for body, and in this case causes the popup to be closed via the first onmousemove event within the "body region" (as opposed to the window's "chrome" or slide bars).  Since you are using REFerence-based positioning to place the popup over the input field(s) which need to be changed, I assume you actually want this behavior, but it is based on a "side effect" rather than an intentional feature for the popups.  It would be better to include the STICKY command and position the popup so that it does not overlap with any input fields, then get rid of the onmouseout for the body start tag.  Because BUBBLE popups do not have a caption with a "close" link, when STICKY they automatically include the NOCLOSE / MOUSEOFF feature such that they close if the user mouses over and then off of the popup.  Another way to get onload STICKY popups to close is by including a TIMEOUT in the overlib call.  In your case, because correction of input field entries is expected, you could add:
 
onfocus="cClick();"
 
to their tag in addition to the previously submitted value, so that the popup closes when the user clicks within an input field to change its entry. 
 
Fote
--
 
----- Original Message -----
From: docdudeus
Sent: Friday, January 06, 2006 2:20 AM
Subject: Re: [OLmws] passing php generated error messages to overlib

Fote,
Cool I got it working.  I made an exact copy of the HTML markup and placed it in the login verification script.  Using the onload= event in the body tag I added the overlib function with the load argument being a php looping command that calls out the error array holding any error messages generated by the verification script. Probably could have setup a Javascript function to make it easier to follow but I'm not proficient in Javascript.
The only problem now is trivial. 
If you look at the URL http://www.jeffexes.com/newtemplate in the status area you'll notice (I set the AUTOSTATUS command in overlib) the html list tags as well as the array values being listed. 
Also when I use ADJBUBBLE command, for some reason it wraps the first line of returned text. As it is now I've removed the ADJBUBBLE command to circumvent this problem. 

Any suggestions?

Very Cool, BTW!!


--- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...> wrote: 
John,

You cannot use the onsubmit event in the initial document to display the error message because the form submission must be received by your server and analyzed by its form handler (i.e., by your "login verification script") before any error could be detected and an error message generated.

A common way of handling the login error is to have your verification script return a version of the initial document with the values for the form's input fields replaced by what the user entered, and a message added about the error.  If you place the error message in a popup invoked via the onload event, you more or less create the illusion that the popup has been added to the initial document, but it is actually the second, "form reply" document.

So what you presently are trying to do via the onsubmit attribute in the form start tag should instead be done via an onload attribute in the body start tag.  For positioning of the popup, you can assign an id to the form start tag or to one of the input tags, and in the overlib call via the onload attribute use the REF command with that id as its parameter.  You can use REFC, REFP, REFX, and/or REFY for optimum positioning of the popup.  See the:

http://www.macridesweb.com/oltest/REF.html

support document for more information about REFerence-based positioning.

Fote

#579 From: "docdudeus" <docdudeus@...>
Date: Fri Jan 6, 2006 11:48 pm
Subject: Re: passing php generated error messages to overlib
docdudeus
Send Email Send Email
 
Ellinika,
Code cleaned up now. I didn't realize I had stumbled onto a desired
effect by dumb luck.  Used your suggestions and actually I like the
way it works now.
Million thanks.
John


--- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...> wrote:
>
> Efaristo,
>
> The code for the ADJBUBBLE feature was designed for BUBBLE popup
content which is plain text or is HTML with only inline markup.  If
you use block-level markup in the content, such as UL and LI in your
case, that can impose its own line breaks and formatting which may not
be taken into account by the ADJBUBBLE code.  So in that case it is
better to omit ADJBUBBLE, as you have done.
>
> The AUTOSTATUS command sends the popup's main content to the status
line, but browsers do not render statusline content, so if it contains
HTML markup you see that as literal.  In your case, you can use STATUS
and make its parameter the same as the overlib call's lead argument
but without the encasing HTML markup.
>
> Note that your login verification script is creating two separate
onload="js_function();" pairs in the body start tag.  To work reliably
across all of the supported browsers, the two javascript function
calls should be concatenated so that you have only one onload attribute:
>
> onload="overlib(...); preloadImages();"
>
> Also note that you are importing the overlibmws_regCore.js plugin
module unnecessarily.  That plugin is for any frames or iframes which
do not themselves import the overlibmws.js core module but instead use
one imported by another frame or the parent.
>
> Finally, I had neglected to indicate that popups invoked via onload
should be STICKY.  You presently are not including that command in the
overlib call, and have placed onmouseout="nd()" in the body start tag.
  The latter event is not supported in a rational way by browsers for
body, and in this case causes the popup to be closed via the first
onmousemove event within the "body region" (as opposed to the window's
"chrome" or slide bars).  Since you are using REFerence-based
positioning to place the popup over the input field(s) which need to
be changed, I assume you actually want this behavior, but it is based
on a "side effect" rather than an intentional feature for the popups.
  It would be better to include the STICKY command and position the
popup so that it does not overlap with any input fields, then get rid
of the onmouseout for the body start tag.  Because BUBBLE popups do
not have a caption with a "close" link, when STICKY they automatically
include the NOCLOSE / MOUSEOFF feature such that they close if the
user mouses over and then off of the popup.  Another way to get onload
STICKY popups to close is by including a TIMEOUT in the overlib call.
  In your case, because correction of input field entries is expected,
you could add:
>
> onfocus="cClick();"
>
> to their tag in addition to the previously submitted value, so that
the popup closes when the user clicks within an input field to change
its entry.
>
> Fote
> --
>
>   ----- Original Message -----
>   From: docdudeus
>   To: overlibmws@yahoogroups.com
>   Sent: Friday, January 06, 2006 2:20 AM
>   Subject: Re: [OLmws] passing php generated error messages to overlib
>
>
>   Fote,
>
>   Cool I got it working.  I made an exact copy of the HTML markup
and placed it in the login verification script.  Using the onload=
event in the body tag I added the overlib function with the load
argument being a php looping command that calls out the error array
holding any error messages generated by the verification script.
Probably could have setup a Javascript function to make it easier to
follow but I'm not proficient in Javascript.
>
>   The only problem now is trivial.
>
>   If you look at the URL http://www.jeffexes.com/newtemplate in the
status area you'll notice (I set the AUTOSTATUS command in overlib)
the html list tags as well as the array values being listed.
>
>   Also when I use ADJBUBBLE command, for some reason it wraps the
first line of returned text. As it is now I've removed the ADJBUBBLE
command to circumvent this problem.
>
>   Any suggestions?
>
>   Very Cool, BTW!!
>
>
>   --- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...>
wrote:
>     John,
>
>     You cannot use the onsubmit event in the initial document to
display the error message because the form submission must be received
by your server and analyzed by its form handler (i.e., by your "login
verification script") before any error could be detected and an error
message generated.
>
>     A common way of handling the login error is to have your
verification script return a version of the initial document with the
values for the form's input fields replaced by what the user entered,
and a message added about the error.  If you place the error message
in a popup invoked via the onload event, you more or less create the
illusion that the popup has been added to the initial document, but it
is actually the second, "form reply" document.
>
>     So what you presently are trying to do via the onsubmit
attribute in the form start tag should instead be done via an onload
attribute in the body start tag.  For positioning of the popup, you
can assign an id to the form start tag or to one of the input tags,
and in the overlib call via the onload attribute use the REF command
with that id as its parameter.  You can use REFC, REFP, REFX, and/or
REFY for optimum positioning of the popup.  See the:
>
>     http://www.macridesweb.com/oltest/REF.html
>
>     support document for more information about REFerence-based
positioning.
>
>     Fote
>

#580 From: "ikey_85" <ikey_85@...>
Date: Tue Jan 10, 2006 4:10 am
Subject: Get overLIB text and caption from file?
ikey_85
Send Email Send Email
 
Is it possible?
1. Is it possible one link to get infos from first.txt and other link
to get the infro from second.txt.
2. Is it possible that to be formated separatly in same overlib text
(ex: first line coloured, second bold,...)

Best regards, Ikey

#581 From: "Foteos Macrides" <fote@...>
Date: Tue Jan 10, 2006 12:28 pm
Subject: Re: [OLmws] Get overLIB text and caption from file?
oldgreeky
Send Email Send Email
 
Ikey,
 
The use of imported files as DHTML popup content commonly is done by making that content an iframe or object element.  The utility scripts iframecontentmws.js and objectcontentmws.js are included in the overlibmws.zip distribution to assist in setting up such content.  Their use is demonstrated in the:
 
and
 
support documents.  You indeed can have multiple links on the page which invoke different popups with different imported files as their content.  However, the caption is intended to be simple, and the support scripts do not include support for using imported files as caption content.
 
The content of the popups is treated as HTML, so that you can use markup such as <b>...</b> to make sections of the content bold, as well as any other HTML and/or CSS-based styling.  I suggest that you review the Getting Started:
 
 
support document and the Command Reference:
 
 
for more information about such matters.  If you still have questions after reviewing them, feel free to post again here.
 
Fote
--
 
----- Original Message -----
From: ikey_85
Sent: Monday, January 09, 2006 11:10 PM
Subject: [OLmws] Get overLIB text and caption from file?

Is it possible?
1. Is it possible one link to get infos from first.txt and other link
to get the infro from second.txt.
2. Is it possible that to be formated separatly in same overlib text
(ex: first line coloured, second bold,...)

Best regards, Ikey

#582 From: "ikey_85" <ikey_85@...>
Date: Tue Jan 10, 2006 5:33 pm
Subject: Re: [OLmws] Get overLIB text and caption from file?
ikey_85
Send Email Send Email
 
EXCELANT :DDD Thanks :D I have one more question thou, I cant hide
that tiny border around the box. I set the 'if1', 0 but I still get
that light-cyan-blue tiny border around. Is it possible to get it off??

Best regards, Ikey

--- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...> wrote:
>
> Ikey,
>
> The use of imported files as DHTML popup content commonly is done by
making that content an iframe or object element.  The utility scripts
iframecontentmws.js and objectcontentmws.js are included in the
overlibmws.zip distribution to assist in set....

#583 From: "Foteos Macrides" <fote@...>
Date: Tue Jan 10, 2006 11:02 pm
Subject: Re: [OLmws] Get overLIB text and caption from file?
oldgreeky
Send Email Send Email
 
Ikey,
 
Setting the frameborder argument in the OLiframeContent(src, width, height, name, frameborder) function to 0 gets rid of the "three-dimensional chrome" border associated with the iframe "window" but in addition your overlib call should include TEXTPADDING,0, BORDER,0 to eliminate the margin and colored border that the popup markup otherwise puts around the content.  If you do not set those to 0 explicitly, their default values are 2 and 1 pixels, respectively, yielding that thin border you presently are seeing.
 
Fote
--
 
----- Original Message -----
From: ikey_85
Sent: Tuesday, January 10, 2006 12:33 PM
Subject: Re: [OLmws] Get overLIB text and caption from file?

EXCELANT :DDD Thanks :D I have one more question thou, I cant hide that tiny border around the box. I set the 'if1', 0 but I still get that light-cyan-blue tiny border around. Is it possible to get it off??

Best regards, Ikey

--- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...> wrote:
Ikey,

The use of imported files as DHTML popup content commonly is done by making that content an iframe or object element.  The utility scripts iframecontentmws.js and objectcontentmws.js are included in the overlibmws.zip distribution to assist in set....

#584 From: "ikey_85" <ikey_85@...>
Date: Thu Jan 12, 2006 3:06 am
Subject: Re: [OLmws] Get overLIB text and caption from file?
ikey_85
Send Email Send Email
 
Here is captured pic:
http://ts2.archaicorder.com/AO/images/border.jpg <- how can I remove
the light border around the popup?

Here is the code:
<a href="http://www.test.com" onMouseOver="return
overlib(OLiframeContent('2ra.html', 200, 145, 'if1', 0), LEFT, BORDER,
0);" onMouseOut="return nd();">

P.S. Adding TEXTPADDING, 0 is making the popup not to show.

Best regards, Ikey


--- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...> wrote:
>
> Ikey,
>
> Setting the frameborder argument in the OLiframeContent(src, width,
height, name, frameborder) function to 0 gets rid of the
"three-dimensional chrome" border associated with the iframe "window"
but in addition your overlib call should include TEXTPADDING,0,
BORDER,0 to eliminate the margin and colored border that the popup
markup otherwise puts aroun............

#585 From: "ikey_85" <ikey_85@...>
Date: Thu Jan 12, 2006 3:15 am
Subject: Re: Get overLIB text and caption from file?
ikey_85
Send Email Send Email
 
I fixed the problem with the border ;D I forgot the overlibmws.js
Thank you very much :DD

Best regards, Ikey

#586 From: "Foteos Macrides" <fote@...>
Date: Thu Jan 12, 2006 12:35 pm
Subject: Re: Get overLIB text and caption from file?
oldgreeky
Send Email Send Email
 
Ikey,
 
For future reference, should you sometime want colored borders around your iframe popup content, the TEXTPADDING command does not normally create a "border" but rather sets the margin width (default is 2) around the main content (foreground) with the same color as the main content, determined by the value of FGCOLOR.  However, when the main content is an iframe element, that sets its own color, typically different from FGCOLOR, and so if you do not set TEXTPADDING to 0 you get a "border" (whose color can be set via FGCOLOR) around the "frameborder" chrome for the iframe window.  The BORDER command sets the border whose "background" color is determined by BGCOLOR, and which normally (default BORDER value is 1) is placed around the entire popup including the caption if one is present.  So if you do not set BORDER to 0 you get that "outermost" border whose color can be set via BGCOLOR.
 
Fote
--
 
----- Original Message -----
From: ikey_85
Sent: Wednesday, January 11, 2006 10:15 PM
Subject: [OLmws] Re: Get overLIB text and caption from file?

I fixed the problem with the border ;D I forgot the overlibmws.js
Thank you very much :DD

Best regards, Ikey

#587 From: "Foteos Macrides" <fote@...>
Date: Sun Jan 22, 2006 2:58 pm
Subject: Re: Link in popup in php
oldgreeky
Send Email Send Email
 
Bobby,
 
The problem is that in the first echo for the php parser you are using single-quotes to specify its string so that you can use double-quotes for the anchor attribute values, and therefore you are using slashes to escape the single-quotes in the overlib calls, but for the overlib call in the value of the onclick attribute you also are using a backslashed single-quote for the embedded quoting of the URL that is the href value in the anchor of that overlib call.  You therefore are prematurely terminating that overlib call.  To avoid the problem, you could change that embedded quoting of the URL to the HTML entity &quot;
 
. . . overlib(\'<a href=&quot;http://simplythebest.net/fonts/&quot;>SimplytheBest Free Fonts</a>\', .
 
There are other ways to deal with this as well.  You might want to look over the support documents for using overlibmws with php:
 
 
 
Feel free to post to the overlibmws Support Group if you have any more questions or problems.
 
Fote
--
 
----- Original Message -----
Sent: Saturday, January 21, 2006 4:56 PM
Subject: Link in popup in php

Hi,
My problem is when I use a sticky popup, or any popup for that matter, I cannot get a link inside the popup when using php.  Here is my code which is just using exactly what Erik Bosrup did in one of his:

echo '<a href="javascript:void(0)" onmouseover="return overlib(\'Click on me!\');"
onclick="return overlib(\'<a href=\'http://simplythebest.net/fonts/\'>\' SimplytheBest Free Fonts\'</a>\', STICKY, CAPTION, \'New!\');"
onmouseout="return nd();" class="bodylink">';
echo "What's new!";
echo "</a>";

I have tried http://simplythebest.net/fonts instead of javascript:void(0) also like he did.  I can get this to work perfectly without being in php, but I need it in php so I can change the link to something that is in mysql.  It wont do anything but the mouseover when the first href is javascript:void(0).  When the first href is http://simplythebest.net/fonts all it will do is go directly to the link, instead of opening up the sticky popup.  It will work either way when it is not php.  I would appreciate any help that you can give.
Thanks in advance.

Bobby

#588 From: "Walter Conti" <walter@...>
Date: Tue Jan 24, 2006 4:44 am
Subject: nd(), cClick, stop play an embedded mp3
contiw
Send Email Send Email
 
I have a "welcome" 15 seconds mp3 that execute the first time a site is
entered. There is also a overlib popup which closes with cClick().

Is not a big deal, but when you close the popup the mp3 stps playing it
it is not finished. Does anybody know how to avoid that?

Thank you. Overlibbing regards.
WalterC

#589 From: "Foteos Macrides" <fote@...>
Date: Tue Jan 24, 2006 2:49 pm
Subject: Re: [OLmws] nd(), cClick, stop play an embedded mp3
oldgreeky
Send Email Send Email
 
Walter,
 
Please provide a URL for a document which shows this problem, or post sufficient markup to reproduce it.
 
Fote
--
 
----- Original Message -----
Sent: Monday, January 23, 2006 11:44 PM
Subject: [OLmws] nd(), cClick, stop play an embedded mp3

I have a "welcome" 15 seconds mp3 that execute the first time a site is entered. There is also a overlib popup which closes with cClick().

Is not a big deal, but when you close the popup the mp3 stps playing it it is not finished. Does anybody know how to avoid that?

Thank you. Overlibbing regards.
WalterC

#590 From: "Walter Conti" <walter@...>
Date: Tue Jan 24, 2006 5:43 pm
Subject: Re: nd(), cClick, stop play an embedded mp3
contiw
Send Email Send Email
 
> Please provide a URL for a document which shows this problem, or
post sufficient markup to reproduce it.
>I have a "welcome" 15 seconds mp3 that execute the first time a site
is entered. There is also a overlib popup which closes with cClick().
>
>   Is not a big deal, but when you close the popup the mp3 stps
playing it it is not finished. Does anybody know how to avoid that?
>

Sure. Thanks.

The overlibstuff:

msg = "<p>asdfasdfasdf ..... asdfasdf</p><span style='font-
size:70%;float:right;margin-top:-10px;'><a class='details'
style='color:white;' href='javascript:void(0)' onClick='cClick
()'><i>Chiudi</i></a></span>";
overlib
(msg,SHADOW,SHADOWX,0,SHADOWY,0,SHADOWCOLOR,'000099',SHADOWOPACITY,82,
WIDTH,360,TEXTFONTCLASS,'oltxtw10',STICKY,MIDY,40,TEXTPADDING,15,BGCOL
OR,'', FGCOLOR, '',EXCLUSIVE);

The EMBED tag :
<EMBED SRC="mp3filename.mp3" HEIGHT=1 WIDTH=1 LOOP=false
AUTOSTART=TRUE HIDDEN=TRUE></embed>

Any .mp3 file will do I suppose. I'll try to put a small one
in "Archive" right here.

Thanks very much.
WalterC

#591 From: "Foteos Macrides" <fote@...>
Date: Tue Jan 24, 2006 7:34 pm
Subject: Re: [OLmws] Re: nd(), cClick, stop play an embedded mp3
oldgreeky
Send Email Send Email
 
Walter,
 
You need a return value of false for the onclick to avoid termination of any still active processes associated with the document, such as the playing of the mp3.  Both cClick() and nd() have return values of false.  So you can use:
 
onclick="return cClick();"
 
or use:
 
onclick="cClick(); return false;"
 
if you was an explicit reminder of the need for that return value.
 
Fote
--
 
----- Original Message -----
Sent: Tuesday, January 24, 2006 12:43 PM
Subject: [OLmws] Re: nd(), cClick, stop play an embedded mp3


> Please provide a URL for a document which shows this problem, or post sufficient markup to reproduce it.  I have a "welcome" 15 seconds mp3 that execute the first time a site is entered. There is also a overlib popup which closes with cClick().
>
>  Is not a big deal, but when you close the popup the mp3 stps playing it it is not finished. Does anybody know how to avoid that?
>

Sure. Thanks.

The overlibstuff:

msg = "<p>asdfasdfasdf .... asdfasdf</p><span style='font-size:70%;float:right;margin-top:-10px;'><a class='details' style='color:white;' href='javascript:void(0)' onClick='cClick()'><i>Chiudi</i></a></span>";
overlib(msg,SHADOW,SHADOWX,0,SHADOWY,0,SHADOWCOLOR,'000099',SHADOWOPACITY,82,
WIDTH,360,TEXTFONTCLASS,'oltxtw10',STICKY,MIDY,40,TEXTPADDING,15,BGCOLOR,'', FGCOLOR, '',EXCLUSIVE);

The EMBED tag :
<EMBED SRC="mp3filename.mp3" HEIGHT=1 WIDTH=1 LOOP=false AUTOSTART=TRUE HIDDEN=TRUE></embed>

Any .mp3 file will do I suppose. I'll try to put a small one in "Archive" right here.

Thanks very much.
WalterC

#592 From: "Walter Conti" <walter@...>
Date: Tue Jan 24, 2006 8:14 pm
Subject: RE: [OLmws] Re: nd(), cClick, stop play an embedded mp3
contiw
Send Email Send Email
 

Thank You Fote. Thanks.

WalterC

 


From: overlibmws@yahoogroups.com [mailto:overlibmws@yahoogroups.com] On Behalf Of Foteos Macrides
Sent: Tuesday, January 24, 2006 11:34 AM
To: overlibmws@yahoogroups.com
Subject: Re: [OLmws] Re: nd(), cClick, stop play an embedded mp3

 

Walter,

 

You need a return value of false for the onclick to avoid termination of any still active processes associated with the document, such as the playing of the mp3.  Both cClick() and nd() have return values of false.  So you can use:

 

onclick="return cClick();"

 

or use:

 

onclick="cClick(); return false;"

 

if you was an explicit reminder of the need for that return value.

 

Fote

--

 

----- Original Message -----

From: Walter Conti

Sent: Tuesday, January 24, 2006 12:43 PM

Subject: [OLmws] Re: nd(), cClick, stop play an embedded mp3

 


> Please provide a URL for a document which shows this problem, or post sufficient markup to reproduce it.  I have a "welcome" 15 seconds mp3 that execute the first time a site is entered. There is also a overlib popup which closes with cClick().
>
>  Is not a big deal, but when you close the popup the mp3 stps playing it it is not finished. Does anybody know how to avoid that?
>

Sure. Thanks.

The overlibstuff:

msg = "<p>asdfasdfasdf .... asdfasdf</p><span style='font-size:70%;float:right;margin-top:-10px;'><a class='details' style='color:white;' href='javascript:void(0)' onClick='cClick()'><i>Chiudi</i></a></span>";
overlib(msg,SHADOW,SHADOWX,0,SHADOWY,0,SHADOWCOLOR,'000099',SHADOWOPACITY,82,
WIDTH,360,TEXTFONTCLASS,'oltxtw10',STICKY,MIDY,40,TEXTPADDING,15,BGCOLOR,'', FGCOLOR, '',EXCLUSIVE);

The EMBED tag :
<EMBED SRC="mp3filename.mp3" HEIGHT=1 WIDTH=1 LOOP=false AUTOSTART=TRUE HIDDEN=TRUE></embed>

Any .mp3 file will do I suppose. I'll try to put a small one in "Archive" right here.

Thanks very much.
WalterC



#593 From: "Foteos Macrides" <fote@...>
Date: Wed Jan 25, 2006 1:29 am
Subject: Re: nd(), cClick, stop play an embedded mp3
oldgreeky
Send Email Send Email
 
Walter,
 
Note that this is basically the same issue that is discussed in the:
 
 
support document concerning how to ensure that images or iframe files complete their loading when using onclick to execute javascript.  That is, this applies to any javascript, and to anything that is still loading or playing, including sounds, flash, or whatever:
 
If the javascript invoked via onclick returns false, then the href is ignored and everything associated with the present document continues to load or play.  If it is true or nothing, then all loading or playing stops and the href is acted upon.  In the latter case if the href is javascript:void(0); rather than a URL, then the current document continues to be displayed rather than a new document being fetched, but any loading or playing for the current document will have halted.  So you still should ensure that false is returned by the javascript executed via onclick.
 
The return value doesn't matter in that respect for onmouseout, and so you can omit the return statement to save a few bytes when using nd() to close non-STICKY popups via onmouseout.
 
Fote
--
 
----- Original Message -----
Sent: Tuesday, January 24, 2006 3:14 PM
Subject: Re: nd(), cClick, stop play an embedded mp3
 
Thank You Fote. Thanks.
WalterC
 
From:overlibmws@yahoogroups.com On Behalf Of Foteos Macrides
Sent: Tuesday, January 24, 2006 11:34 AM
Subject: Re: nd(), cClick, stop play an embedded mp3
 
Walter,
 
You need a return value of false for the onclick to avoid termination of any still active processes associated with the document, such as the playing of the mp3.  Both cClick() and nd() have return values of false.  So you can use:
 
onclick="return cClick();"
 
or use:
 
onclick="cClick(); return false;"
 
if you want an explicit reminder of the need for that return value.
 
Fote

#594 From: "docdudeus" <docdudeus@...>
Date: Thu Feb 2, 2006 11:04 pm
Subject: Re: passing php generated error messages to overlib Revisited
docdudeus
Send Email Send Email
 
Hello again,
Many revisions to the site and now I've run into a problem with by
login bubble routine.

I've set a conditional that determines which <body> markup to load
depending on the value of HTML_GET_VARS.  So now I have to echo the
html markup to the php parser like so:

<?php
if($HTTP_GET_VARS['errmsg'])
{$eg_error['logout'] = $HTTP_GET_VARS['errmsg'];

echo "<body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0
bgcolor=#ffffff onload=\"return
overlib('<?if(!empty($eg_error)){?><ul><?foreach($eg_error as
$eg_message){?><li><?= @$eg_message
?></li><?}?></ul><? } ?>', BUBBLE, BUBBLETYPE, 'oval',
STICKY, STATUS, '<?if(!empty($eg_error)){?><?foreach($eg_error as
$eg_message){?>  <?= @$eg_message ?><?}?><? } ?>',TEXTCOLOR,
'#FF0000', TEXTSIZE, 2, FILTER,
FILTERSHADOW,1,FILTERSHADOWCOLOR,'purple', REF,'fox', REFY, 85, REFX,
45);\" >";
  }
else {
echo "<body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0
bgcolor=#ffffff>";
} ?>

Now without having to echo the markup everything works fine as
previously discussed in our threads.  I know it has something to do
with the quotes and included php conditionals/functions.  Any help
would be appreciated.
John



> --- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...> wrote:
> >
> > Efaristo,
> >
> > The code for the ADJBUBBLE feature was designed for BUBBLE popup
> content which is plain text or is HTML with only inline markup.  If
> you use block-level markup in the content, such as UL and LI in your
> case, that can impose its own line breaks and formatting which may not
> be taken into account by the ADJBUBBLE code.  So in that case it is
> better to omit ADJBUBBLE, as you have done.
> >
> > The AUTOSTATUS command sends the popup's main content to the status
> line, but browsers do not render statusline content, so if it contains
> HTML markup you see that as literal.  In your case, you can use STATUS
> and make its parameter the same as the overlib call's lead argument
> but without the encasing HTML markup.
> >
> > Note that your login verification script is creating two separate
> onload="js_function();" pairs in the body start tag.  To work reliably
> across all of the supported browsers, the two javascript function
> calls should be concatenated so that you have only one onload attribute:
> >
> > onload="overlib(...); preloadImages();"
> >
> > Also note that you are importing the overlibmws_regCore.js plugin
> module unnecessarily.  That plugin is for any frames or iframes which
> do not themselves import the overlibmws.js core module but instead use
> one imported by another frame or the parent.
> >
> > Finally, I had neglected to indicate that popups invoked via onload
> should be STICKY.  You presently are not including that command in the
> overlib call, and have placed onmouseout="nd()" in the body start tag.
>  The latter event is not supported in a rational way by browsers for
> body, and in this case causes the popup to be closed via the first
> onmousemove event within the "body region" (as opposed to the window's
> "chrome" or slide bars).  Since you are using REFerence-based
> positioning to place the popup over the input field(s) which need to
> be changed, I assume you actually want this behavior, but it is based
> on a "side effect" rather than an intentional feature for the popups.
>  It would be better to include the STICKY command and position the
> popup so that it does not overlap with any input fields, then get rid
> of the onmouseout for the body start tag.  Because BUBBLE popups do
> not have a caption with a "close" link, when STICKY they automatically
> include the NOCLOSE / MOUSEOFF feature such that they close if the
> user mouses over and then off of the popup.  Another way to get onload
> STICKY popups to close is by including a TIMEOUT in the overlib call.
>  In your case, because correction of input field entries is expected,
> you could add:
> >
> > onfocus="cClick();"
> >
> > to their tag in addition to the previously submitted value, so that
> the popup closes when the user clicks within an input field to change
> its entry.
> >
> > Fote
> > --
> >
> >   ----- Original Message -----
> >   From: docdudeus
> >   To: overlibmws@yahoogroups.com
> >   Sent: Friday, January 06, 2006 2:20 AM
> >   Subject: Re: [OLmws] passing php generated error messages to overlib
> >
> >
> >   Fote,
> >
> >   Cool I got it working.  I made an exact copy of the HTML markup
> and placed it in the login verification script.  Using the onload=
> event in the body tag I added the overlib function with the load
> argument being a php looping command that calls out the error array
> holding any error messages generated by the verification script.
> Probably could have setup a Javascript function to make it easier to
> follow but I'm not proficient in Javascript.
> >
> >   The only problem now is trivial.
> >
> >   If you look at the URL http://www.jeffexes.com/newtemplate in the
> status area you'll notice (I set the AUTOSTATUS command in overlib)
> the html list tags as well as the array values being listed.
> >
> >   Also when I use ADJBUBBLE command, for some reason it wraps the
> first line of returned text. As it is now I've removed the ADJBUBBLE
> command to circumvent this problem.
> >
> >   Any suggestions?
> >
> >   Very Cool, BTW!!
> >
> >
> >   --- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...>
> wrote:
> >     John,
> >
> >     You cannot use the onsubmit event in the initial document to
> display the error message because the form submission must be received
> by your server and analyzed by its form handler (i.e., by your "login
> verification script") before any error could be detected and an error
> message generated.
> >
> >     A common way of handling the login error is to have your
> verification script return a version of the initial document with the
> values for the form's input fields replaced by what the user entered,
> and a message added about the error.  If you place the error message
> in a popup invoked via the onload event, you more or less create the
> illusion that the popup has been added to the initial document, but it
> is actually the second, "form reply" document.
> >
> >     So what you presently are trying to do via the onsubmit
> attribute in the form start tag should instead be done via an onload
> attribute in the body start tag.  For positioning of the popup, you
> can assign an id to the form start tag or to one of the input tags,
> and in the overlib call via the onload attribute use the REF command
> with that id as its parameter.  You can use REFC, REFP, REFX, and/or
> REFY for optimum positioning of the popup.  See the:
> >
> >     http://www.macridesweb.com/oltest/REF.html
> >
> >     support document for more information about REFerence-based
> positioning.
> >
> >     Fote
> >
>

#595 From: "docdudeus" <docdudeus@...>
Date: Fri Feb 3, 2006 12:55 am
Subject: Re: passing php generated error messages to overlib Revisited .... SOLVED!!
docdudeus
Send Email Send Email
 
Hello,
I solved my problem by embedding my HTML <body> markup in my php
conditionals.  I knew I already had the overlib function working, what
I needed was to conditionally load it in the <body> markup depending
on whether an error message was passed to the page. I changed the
conditionals to embedding the HTML rather than using echo() to send
the markup. QID:

<?php
if($HTTP_GET_VARS['errmsg'])
{$eg_error['logout'] = $HTTP_GET_VARS['errmsg'];
  ?>
<body leftmargin=0 topmargin=0 marginheight="0" marginwidth="0"
bgcolor="#ffffff" onload="return
overlib('<?if(!empty($eg_error)){?><ul><?foreach($eg_error as
$eg_message){?><li><?= @$eg_message
?></li><?}?></ul><? } ?>', BUBBLE, BUBBLETYPE, 'oval',
STICKY, STATUS, '<?if(!empty($eg_error)){?><?foreach($eg_error as
$eg_message){?>  <?= @$eg_message ?><?}?><? } ?>',TEXTCOLOR,
'#FF0000', TEXTSIZE, 2, FILTER,
FILTERSHADOW,1,FILTERSHADOWCOLOR,'purple', REF,'fox', REFY, 85, REFX,
45);" >
<?php }
else { ?>
<body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0
bgcolor=#ffffff>
<?php } ?>

Educational for me, but once I looked "outside of the box", the
solution came to me.  See this link
http://www.onlamp.com/pub/a/php/2001/05/03/php_foundations.html for
more info on embedding HTML in php.

Thanks,
John


--- In overlibmws@yahoogroups.com, "docdudeus" <docdudeus@...> wrote:
>
> Hello again,
> Many revisions to the site and now I've run into a problem with by
> login bubble routine.
>
> I've set a conditional that determines which <body> markup to load
> depending on the value of HTML_GET_VARS.  So now I have to echo the
> html markup to the php parser like so:
>
> <?php
> if($HTTP_GET_VARS['errmsg'])
> {$eg_error['logout'] = $HTTP_GET_VARS['errmsg'];
>
> echo "<body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0
> bgcolor=#ffffff onload=\"return
> overlib('<?if(!empty($eg_error)){?><ul><?foreach($eg_error as
> $eg_message){?><li><?= @$eg_message
> ?></li><?}?></ul><? } ?>', BUBBLE, BUBBLETYPE, 'oval',
> STICKY, STATUS, '<?if(!empty($eg_error)){?><?foreach($eg_error as
> $eg_message){?>  <?= @$eg_message ?><?}?><? } ?>',TEXTCOLOR,
> '#FF0000', TEXTSIZE, 2, FILTER,
> FILTERSHADOW,1,FILTERSHADOWCOLOR,'purple', REF,'fox', REFY, 85, REFX,
> 45);\" >";
>  }
> else {
> echo "<body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0
> bgcolor=#ffffff>";
> } ?>
>
> Now without having to echo the markup everything works fine as
> previously discussed in our threads.  I know it has something to do
> with the quotes and included php conditionals/functions.  Any help
> would be appreciated.
> John
>
>
>
> > --- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...>
wrote:
> > >
> > > Efaristo,
> > >
> > > The code for the ADJBUBBLE feature was designed for BUBBLE popup
> > content which is plain text or is HTML with only inline markup.  If
> > you use block-level markup in the content, such as UL and LI in your
> > case, that can impose its own line breaks and formatting which may not
> > be taken into account by the ADJBUBBLE code.  So in that case it is
> > better to omit ADJBUBBLE, as you have done.
> > >
> > > The AUTOSTATUS command sends the popup's main content to the status
> > line, but browsers do not render statusline content, so if it contains
> > HTML markup you see that as literal.  In your case, you can use STATUS
> > and make its parameter the same as the overlib call's lead argument
> > but without the encasing HTML markup.
> > >
> > > Note that your login verification script is creating two separate
> > onload="js_function();" pairs in the body start tag.  To work reliably
> > across all of the supported browsers, the two javascript function
> > calls should be concatenated so that you have only one onload
attribute:
> > >
> > > onload="overlib(...); preloadImages();"
> > >
> > > Also note that you are importing the overlibmws_regCore.js plugin
> > module unnecessarily.  That plugin is for any frames or iframes which
> > do not themselves import the overlibmws.js core module but instead use
> > one imported by another frame or the parent.
> > >
> > > Finally, I had neglected to indicate that popups invoked via onload
> > should be STICKY.  You presently are not including that command in the
> > overlib call, and have placed onmouseout="nd()" in the body start tag.
> >  The latter event is not supported in a rational way by browsers for
> > body, and in this case causes the popup to be closed via the first
> > onmousemove event within the "body region" (as opposed to the window's
> > "chrome" or slide bars).  Since you are using REFerence-based
> > positioning to place the popup over the input field(s) which need to
> > be changed, I assume you actually want this behavior, but it is based
> > on a "side effect" rather than an intentional feature for the popups.
> >  It would be better to include the STICKY command and position the
> > popup so that it does not overlap with any input fields, then get rid
> > of the onmouseout for the body start tag.  Because BUBBLE popups do
> > not have a caption with a "close" link, when STICKY they automatically
> > include the NOCLOSE / MOUSEOFF feature such that they close if the
> > user mouses over and then off of the popup.  Another way to get onload
> > STICKY popups to close is by including a TIMEOUT in the overlib call.
> >  In your case, because correction of input field entries is expected,
> > you could add:
> > >
> > > onfocus="cClick();"
> > >
> > > to their tag in addition to the previously submitted value, so that
> > the popup closes when the user clicks within an input field to change
> > its entry.
> > >
> > > Fote
> > > --
> > >
> > >   ----- Original Message -----
> > >   From: docdudeus
> > >   To: overlibmws@yahoogroups.com
> > >   Sent: Friday, January 06, 2006 2:20 AM
> > >   Subject: Re: [OLmws] passing php generated error messages to
overlib
> > >
> > >
> > >   Fote,
> > >
> > >   Cool I got it working.  I made an exact copy of the HTML markup
> > and placed it in the login verification script.  Using the onload=
> > event in the body tag I added the overlib function with the load
> > argument being a php looping command that calls out the error array
> > holding any error messages generated by the verification script.
> > Probably could have setup a Javascript function to make it easier to
> > follow but I'm not proficient in Javascript.
> > >
> > >   The only problem now is trivial.
> > >
> > >   If you look at the URL http://www.jeffexes.com/newtemplate in the
> > status area you'll notice (I set the AUTOSTATUS command in overlib)
> > the html list tags as well as the array values being listed.
> > >
> > >   Also when I use ADJBUBBLE command, for some reason it wraps the
> > first line of returned text. As it is now I've removed the ADJBUBBLE
> > command to circumvent this problem.
> > >
> > >   Any suggestions?
> > >
> > >   Very Cool, BTW!!
> > >
> > >
> > >   --- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...>
> > wrote:
> > >     John,
> > >
> > >     You cannot use the onsubmit event in the initial document to
> > display the error message because the form submission must be received
> > by your server and analyzed by its form handler (i.e., by your "login
> > verification script") before any error could be detected and an error
> > message generated.
> > >
> > >     A common way of handling the login error is to have your
> > verification script return a version of the initial document with the
> > values for the form's input fields replaced by what the user entered,
> > and a message added about the error.  If you place the error message
> > in a popup invoked via the onload event, you more or less create the
> > illusion that the popup has been added to the initial document, but it
> > is actually the second, "form reply" document.
> > >
> > >     So what you presently are trying to do via the onsubmit
> > attribute in the form start tag should instead be done via an onload
> > attribute in the body start tag.  For positioning of the popup, you
> > can assign an id to the form start tag or to one of the input tags,
> > and in the overlib call via the onload attribute use the REF command
> > with that id as its parameter.  You can use REFC, REFP, REFX, and/or
> > REFY for optimum positioning of the popup.  See the:
> > >
> > >     http://www.macridesweb.com/oltest/REF.html
> > >
> > >     support document for more information about REFerence-based
> > positioning.
> > >
> > >     Fote
> > >
> >
>

#596 From: "Foteos Macrides" <fote@...>
Date: Fri Feb 3, 2006 2:36 am
Subject: Re: passing php generated error messages to overlib Revisited .... SOLVED!!
oldgreeky
Send Email Send Email
 
Yassou John,
 
Congratulations on solving the problem, and thanks for posting the informational URL.
 
You might also want to review the
 
 
and
 
 
support documents concerning the handling of php-mediated overlib arguments, particularly if they might include their own single- or double-quotes or other potentially problem characters (which your error messages apparently do not).
 
Fote
--
 
----- Original Message -----
From: docdudeus
Sent: Thursday, February 02, 2006 7:55 PM
Subject: [OLmws] Re: passing php generated error messages to overlib Revisited .... SOLVED!!

Hello,
I solved my problem by embedding my HTML <body> markup in my php
conditionals.  I knew I already had the overlib function working, what
I needed was to conditionally load it in the <body> markup depending
on whether an error message was passed to the page. I changed the
conditionals to embedding the HTML rather than using echo() to send
the markup. QID:

<?php
if($HTTP_GET_VARS['errmsg']) 
{$eg_error['logout'] = $HTTP_GET_VARS['errmsg'];
 ?>
<body leftmargin=0 topmargin=0 marginheight="0" marginwidth="0"
bgcolor="#ffffff" onload="return
overlib('<?if(!empty($eg_error)){?>&lt;ul&gt;<?foreach($eg_error as
$eg_message){?>&lt;li&gt;<?= @$eg_message
?>&lt;/li&gt;<?}?>&lt;/ul&gt;<? } ?>', BUBBLE, BUBBLETYPE, 'oval',
STICKY, STATUS, '<?if(!empty($eg_error)){?><?foreach($eg_error as
$eg_message){?>  <?= @$eg_message ?><?}?><? } ?>',TEXTCOLOR,
'#FF0000', TEXTSIZE, 2, FILTER,
FILTERSHADOW,1,FILTERSHADOWCOLOR,'purple', REF,'fox', REFY, 85, REFX,
45);" >
<?php }
else { ?>
<body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0
bgcolor=#ffffff>
<?php } ?>

Educational for me, but once I looked "outside of the box", the
solution came to me.  See this link
http://www.onlamp.com/pub/a/php/2001/05/03/php_foundations.html for
more info on embedding HTML in php.

Thanks,
John
 

--- In overlibmws@yahoogroups.com, "docdudeus" <docdudeus@...> wrote:
>
> Hello again,
> Many revisions to the site and now I've run into a problem with by
> login bubble routine.
>
> I've set a conditional that determines which <body> markup to load
> depending on the value of HTML_GET_VARS.  So now I have to echo the
> html markup to the php parser like so:
>
> <?php
> if($HTTP_GET_VARS['errmsg']) 
> {$eg_error['logout'] = $HTTP_GET_VARS['errmsg'];
>
> echo "<body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0
> bgcolor=#ffffff onload=\"return
> overlib('<?if(!empty($eg_error)){?>&lt;ul&gt;<?foreach($eg_error as
> $eg_message){?>&lt;li&gt;<?= @$eg_message
> ?>&lt;/li&gt;<?}?>&lt;/ul&gt;<? } ?>', BUBBLE, BUBBLETYPE, 'oval',
> STICKY, STATUS, '<?if(!empty($eg_error)){?><?foreach($eg_error as
> $eg_message){?>  <?= @$eg_message ?><?}?><? } ?>',TEXTCOLOR,
> '#FF0000', TEXTSIZE, 2, FILTER,
> FILTERSHADOW,1,FILTERSHADOWCOLOR,'purple', REF,'fox', REFY, 85, REFX,
> 45);\" >";
>  }
> else {
> echo "<body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0
> bgcolor=#ffffff>";
> } ?>
>
> Now without having to echo the markup everything works fine as
> previously discussed in our threads.  I know it has something to do
> with the quotes and included php conditionals/functions.  Any help
> would be appreciated.
> John
>
>
>
> > --- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...>
wrote:
> > >
> > > Efaristo,
> > >
> > > The code for the ADJBUBBLE feature was designed for BUBBLE popup
> > content which is plain text or is HTML with only inline markup.  If
> > you use block-level markup in the content, such as UL and LI in your
> > case, that can impose its own line breaks and formatting which may not
> > be taken into account by the ADJBUBBLE code.  So in that case it is
> > better to omit ADJBUBBLE, as you have done.
> > >
> > > The AUTOSTATUS command sends the popup's main content to the status
> > line, but browsers do not render statusline content, so if it contains
> > HTML markup you see that as literal.  In your case, you can use STATUS
> > and make its parameter the same as the overlib call's lead argument
> > but without the encasing HTML markup.
> > >
> > > Note that your login verification script is creating two separate
> > onload="js_function();" pairs in the body start tag.  To work reliably
> > across all of the supported browsers, the two javascript function
> > calls should be concatenated so that you have only one onload
attribute:
> > >
> > > onload="overlib(...); preloadImages();"
> > >
> > > Also note that you are importing the overlibmws_regCore.js plugin
> > module unnecessarily.  That plugin is for any frames or iframes which
> > do not themselves import the overlibmws.js core module but instead use
> > one imported by another frame or the parent.
> > >
> > > Finally, I had neglected to indicate that popups invoked via onload
> > should be STICKY.  You presently are not including that command in the
> > overlib call, and have placed onmouseout="nd()" in the body start tag.
> >  The latter event is not supported in a rational way by browsers for
> > body, and in this case causes the popup to be closed via the first
> > onmousemove event within the "body region" (as opposed to the window's
> > "chrome" or slide bars).  Since you are using REFerence-based
> > positioning to place the popup over the input field(s) which need to
> > be changed, I assume you actually want this behavior, but it is based
> > on a "side effect" rather than an intentional feature for the popups.
> >  It would be better to include the STICKY command and position the
> > popup so that it does not overlap with any input fields, then get rid
> > of the onmouseout for the body start tag.  Because BUBBLE popups do
> > not have a caption with a "close" link, when STICKY they automatically
> > include the NOCLOSE / MOUSEOFF feature such that they close if the
> > user mouses over and then off of the popup.  Another way to get onload
> > STICKY popups to close is by including a TIMEOUT in the overlib call.
> >  In your case, because correction of input field entries is expected,
> > you could add:
> > >
> > > onfocus="cClick();"
> > >
> > > to their tag in addition to the previously submitted value, so that
> > the popup closes when the user clicks within an input field to change
> > its entry.
> > >
> > > Fote
> > > --
> > >
> > >   ----- Original Message -----
> > >   From: docdudeus
> > >   To: overlibmws@yahoogroups.com
> > >   Sent: Friday, January 06, 2006 2:20 AM
> > >   Subject: Re: [OLmws] passing php generated error messages to
overlib
> > >
> > >
> > >   Fote,
> > >
> > >   Cool I got it working.  I made an exact copy of the HTML markup
> > and placed it in the login verification script.  Using the onload=
> > event in the body tag I added the overlib function with the load
> > argument being a php looping command that calls out the error array
> > holding any error messages generated by the verification script.
> > Probably could have setup a Javascript function to make it easier to
> > follow but I'm not proficient in Javascript.
> > >
> > >   The only problem now is trivial. 
> > >
> > >   If you look at the URL http://www.jeffexes.com/newtemplate in the
> > status area you'll notice (I set the AUTOSTATUS command in overlib)
> > the html list tags as well as the array values being listed. 
> > >
> > >   Also when I use ADJBUBBLE command, for some reason it wraps the
> > first line of returned text. As it is now I've removed the ADJBUBBLE
> > command to circumvent this problem. 
> > >
> > >   Any suggestions?
> > >
> > >   Very Cool, BTW!!
> > >
> > >
> > >   --- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...>
> > wrote:
> > >     John,
> > >
> > >     You cannot use the onsubmit event in the initial document to
> > display the error message because the form submission must be received
> > by your server and analyzed by its form handler (i.e., by your "login
> > verification script") before any error could be detected and an error
> > message generated.
> > >
> > >     A common way of handling the login error is to have your
> > verification script return a version of the initial document with the
> > values for the form's input fields replaced by what the user entered,
> > and a message added about the error.  If you place the error message
> > in a popup invoked via the onload event, you more or less create the
> > illusion that the popup has been added to the initial document, but it
> > is actually the second, "form reply" document.
> > >
> > >     So what you presently are trying to do via the onsubmit
> > attribute in the form start tag should instead be done via an onload
> > attribute in the body start tag.  For positioning of the popup, you
> > can assign an id to the form start tag or to one of the input tags,
> > and in the overlib call via the onload attribute use the REF command
> > with that id as its parameter.  You can use REFC, REFP, REFX, and/or
> > REFY for optimum positioning of the popup.  See the:
> > >
> > >     http://www.macridesweb.com/oltest/REF.html
> > >
> > >     support document for more information about REFerence-based
> > positioning.
> > >
> > >     Fote

#597 From: "docdudeus" <docdudeus@...>
Date: Sun Feb 19, 2006 9:55 am
Subject: Onload event call to overlib and another function causing conflict?
docdudeus
Send Email Send Email
 
Ellinika,

Fote, I've got a page where I'm using javascript to essentially save form data before it is submitted in a cookie array. The call to the save data function is via an onunload event in the <body> tag.  The call to the  recall data is in the onload event also in the <body> tag.  The problem occurs when the body tag containing the onload event that invokes both the overlib function and the recall data function are fired at the same time.  Only overlib will fire, since it is listed first in the event call. Vice versa if the recall function is listed first.

See below the <body> tags.  BTW the <body> is embedded in a php conditional that determines if a message has been generated or not, one contains overlib the other does not:

<? if(!empty($_REQUEST['msg'])) $eg_error['msg']=$_REQUEST['msg']; ?>
<? if(!empty($eg_error)) { ?>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="return overlib('<?if(!empty($eg_error)){?>&lt;ul&gt;<?foreach($eg_error as $eg_message){?>&lt;li&gt;<?= @$eg_message ?>&lt;/li&gt;<?}?>&lt;/ul&gt;<?} ?>', BUBBLE,  BUBBLETYPE, 'oval', STICKY, STATUS, '<?if(!empty($eg_error)){?><?foreach($eg_error as $eg_message){?>  <?= @$eg_message ?><?}?><?} ?>',TEXTCOLOR, '#FF0000', TEXTSIZE, 2, FILTER, FILTERSHADOW,1,FILTERSHADOWCOLOR,'purple', REF,'newfox', REFC, 'LL', REFY, -20, REFX, 40); recoverInputs(document.forms.Form1,retrieveCookie('iki'),true); " onunload="setCookie('iki',getFormString(document.forms.Form1,true));">
<? }
 else {?>
 <body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="recoverInputs(document.forms.Form1,retrieveCookie('iki'),true);"  onunload="setCookie('iki',getFormString(document.forms.Form1,true));">
<? } ?>

<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>  

Any ideas?

Also, will the overlibmws bubble superimpose over a .swf movie.  It works fine in Internet Explorer but not in Firefox, imagine that!  I've played with the zlib parameter but no go with Firefox.

To see the difference:

With FF: http://www.jeffexes.com/newtemplate/index.php?errmsg=Any query!!!

With IE: http://www.jeffexes.com/newtemplate/index.php?errmsg=Another query!!!

Thanks,

John.




#598 From: "Foteos Macrides" <fote@...>
Date: Sun Feb 19, 2006 6:33 pm
Subject: Re: [OLmws] Onload event call to overlib and another function causing conflict?
oldgreeky
Send Email Send Email
 
----- Original Message -----
I've got a page where I'm using javascript to essentially save form data before it is submitted in a cookie array. The call to the save data function is via an onunload event in the <body> tag.  The call to the  recall data is in the onload event also in the <body> tag.  The problem occurs when the body tag containing the onload event that invokes both the overlib function and the recall data function are fired at the same time.  Only overlib will fire, since it is listed first in the event call. Vice versa if the recall function is listed first.

See below the <body> tags.  BTW the <body> is embedded in a php conditional that determines if a message has been generated or not, one contains overlib the other does not:

<? if(!empty($_REQUEST['msg'])) $eg_error['msg']=$_REQUEST['msg']; ?>
<? if(!empty($eg_error)) { ?>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="return overlib('<?if(!empty($eg_error)){?>&lt;ul&gt;<?foreach($eg_error as $eg_message){?>&lt;li&gt;<?= @$eg_message ?>&lt;/li&gt;<?}?>&lt;/ul&gt;<?} ?>', BUBBLE,  BUBBLETYPE, 'oval', STICKY, STATUS, '<?if(!empty($eg_error)){?><?foreach($eg_error as $eg_message){?>  <?= @$eg_message ?><?}?><?} ?>',TEXTCOLOR, '#FF0000', TEXTSIZE, 2, FILTER, FILTERSHADOW,1,FILTERSHADOWCOLOR,'purple', REF,'newfox', REFC, 'LL', REFY, -20, REFX, 40); recoverInputs(document.forms.Form1,retrieveCookie('iki'),true); " onunload="setCookie('iki',getFormString(document.forms.Form1,true));">
<? }
 else {?>
 <body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="recoverInputs(document.forms.Form1,retrieveCookie('iki'),true);"  onunload="setCookie('iki',getFormString(document.forms.Form1,true));">
<? } ?>

<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>  

Any ideas?
 
Your immediate problem is the inclusion of a return token before the overlib call in the onload attribute value.  That causes a return following that function and thus failure to execute any subsequent javascript, i.e., in this case the recoverInputs call.  I assume that when you tried reversing the order of those two function calls you retained the lead return token, and that is why again only the first call actually was cued.  You do not need a return token in the onload attribute value, and should simply remove it so that all of the javascript in the value gets cued.
 
You should include a return token for the overlib call only when it is in an onmouseover attribute value, because in that case internal overlib code is used to return true or false as required by various browsers depending on whether the STATUS, AUTOSTATUS, or AUTOSTATUSCAP command is used in the overlib call to set the statusline.  Do not include that token for other event-oriented attributes, except that with onclick you may need to force a return value of false as discusssed in:
 
 
Fote
--
 

#599 From: "Foteos Macrides" <fote@...>
Date: Sun Feb 19, 2006 11:27 pm
Subject: Re: Problem with flash in Firefox (was: Onload event call to overlib ...)
oldgreeky
Send Email Send Email
 
----- Original Message -----
. . . will the overlibmws bubble superimpose over a .swf movie.  It works fine in Internet Explorer but not in Firefox, imagine that!  I've played with the zlib parameter but no go with Firefox.

To see the difference:

With FF: http://www.jeffexes.com/newtemplate/index.php?errmsg=Any%20query!!!

With IE: http://www.jeffexes.com/newtemplate/index.php?errmsg=Another%20query!!!
 
John,
 
You are setting the wmode to "transparent" for your flash, as discussed in the:
 
 
support document, and that should prevent the .swf movie from obscuring the overlib popup in Firefox as well as IE.  I modified the support document into a temporary test document:
 
 
which uses BUBBLE and invokes an overlapping popup via onload with code similar to yours.  You also can evoke an overlapping bubble popup via the "Pop me!!!" link within the test document.  In both cases, my .swf movie does not obscure the bubble popup with either Firefox or IE.  I'm at a loss to explain why there is a failure for Firefox with your .swf movie but not mine.  I'll play with it some more when I get a chance, and will post again if I get anywhere with this.  If you or anyone else should figure it out, please be sure to post here.
 
Fote
--
 

#600 From: "Foteos Macrides" <fote@...>
Date: Mon Feb 20, 2006 5:03 am
Subject: Re: Problem with flash in Firefox (was: Onload event call to overlib ...)
oldgreeky
Send Email Send Email
 
John,
 
Oh, the problem has a simple explanation.  IE uses the object markup for flash and in that you have a param element which sets wmode to "transparent" but Firefox uses the embed markup and you forgot to include wmode="transparent" in it for the flash case which gets overlapped by the overlib popup.  Simply add the wmode="transparent" to that embed markup and the problem will go away for Firefox as well.
 
Fote
--
 
----- Original Message -----
Sent: Sunday, February 19, 2006 6:27 PM
Subject: Re: Problem with flash in Firefox (was: Onload event call to overlib ...)

----- Original Message -----
. . . will the overlibmws bubble superimpose over a .swf movie.  It works fine in Internet Explorer but not in Firefox, imagine that!  I've played with the zlib parameter but no go with Firefox.

To see the difference:

With FF: http://www.jeffexes.com/newtemplate/index.php?errmsg=Any%20query!!!

With IE: http://www.jeffexes.com/newtemplate/index.php?errmsg=Another%20query!!!
 
John,
 
You are setting the wmode to "transparent" for your flash, as discussed in the:
 
 
support document, and that should prevent the .swf movie from obscuring the overlib popup in Firefox as well as IE.  I modified the support document into a temporary test document:
 
 
which uses BUBBLE and invokes an overlapping popup via onload with code similar to yours.  You also can evoke an overlapping bubble popup via the "Pop me!!!" link within the test document.  In both cases, my swf movie does not obscure the bubble popup with either Firefox or IE.  I'm at a loss to explain why there is a failure for Firefox with your .swf movie but not mine.  I'll play with it some more when I get a chance, and will post again if I get anywhere with this.  If you or anyone else should figure it out, please be sure to post here.
 
Fote

#601 From: "docdudeus" <docdudeus@...>
Date: Mon Feb 20, 2006 5:45 am
Subject: Re: Problem with flash in Firefox (was: Onload event call to overlib ...)
docdudeus
Send Email Send Email
 
Fote,

Just figured it out.  I left the embed wmode markup out.  Saw this
reply and noticed you found the same error.
As for the other issue with the conflict. I removed the return and now
both functions are fired off. For my own education why is the return
not necessary for an onload event but is for onmouseover or onclick?
I'm not sure I understand.  Is it the internal code that requires
returning a function state for the latter events which is not required
for the onload event?

Thanks,

John



--- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@...> wrote:
>
> John,
>
> Oh, the problem has a simple explanation.  IE uses the object markup
for flash and in that you have a param element which sets wmode to
"transparent" but Firefox uses the embed markup and you forgot to
include wmode="transparent" in it for the flash case which gets
overlapped by the overlib popup.  Simply add the wmode="transparent"
to that embed markup and the problem will go away for Firefox as well.
>
> Fote
> --
>
>   ----- Original Message -----
>   From: Foteos Macrides
>   To: overlibmws@yahoogroups.com
>   Sent: Sunday, February 19, 2006 6:27 PM
>   Subject: Re: Problem with flash in Firefox (was: Onload event call
to overlib ...)
>
>
>     ----- Original Message -----
>     . . . will the overlibmws bubble superimpose over a .swf movie.
  It works fine in Internet Explorer but not in Firefox, imagine that!
  I've played with the zlib parameter but no go with Firefox.
>
>     To see the difference:
>
>     With FF:
http://www.jeffexes.com/newtemplate/index.php?errmsg=Any%20query!!!
>
>     With IE:
http://www.jeffexes.com/newtemplate/index.php?errmsg=Another%20query!!!
>
>   John,
>
>   You are setting the wmode to "transparent" for your flash, as
discussed in the:
>
>   http://www.macridesweb.com/oltest/flashWmode.html
>
>   support document, and that should prevent the .swf movie from
obscuring the overlib popup in Firefox as well as IE.  I modified the
support document into a temporary test document:
>
>   http://www.macridesweb.com/oltest/flashWmode_bubble.html
>
>   which uses BUBBLE and invokes an overlapping popup via onload with
code similar to yours.  You also can evoke an overlapping bubble popup
via the "Pop me!!!" link within the test document.  In both cases, my
swf movie does not obscure the bubble popup with either Firefox or IE.
  I'm at a loss to explain why there is a failure for Firefox with your
swf movie but not mine.  I'll play with it some more when I get a
chance, and will post again if I get anywhere with this.  If you or
anyone else should figure it out, please be sure to post here.
>
>   Fote
>

#602 From: "docdudeus" <docdudeus@...>
Date: Mon Feb 20, 2006 7:25 am
Subject: Problem with focus and hover attributes and overlib with Internet Explorer
docdudeus
Send Email Send Email
 
Fote,

After you helped me solving the last two issues on my form pages I
noticed a problem in IE with my input, select, textarea attributes.  I
have a style sheet that sets the attributes for these tags, works great
in FF, IE required using javascript to set the attributes "on-the-fly"
via class name replacement of thoses tags.  It will only load if the
browser is IE since I commented a conditional in the header section.

However, once overlib fires I noticed that the java script no longer
works.

It is loaded, as using a DOM inspector shows, but the class replacements
for the input, select and other tags in my form are not present.

If I use the defer attribute that is only recognized by IE in the script
call of focus_js.js, the class name replacement occurs but then the form
saving scripts(recoverinputs) and overlib don't work.  Ideally I would
like to have them all coexist.  Must be an onload issue since I call
overlib and recoverinputs in the <body onload="overlib(....);
recoverinputs(......);> and focus_js.js in an external script with the
window.onload function().  Here is a copy of focus_js.js:

window.onload = function()

{
var inputs = document.getElementsByTagName("input");
for(var i = 0; i < inputs.length; i++){
inputs[i].onmouseover = function(){
this.className += " hover";
}
inputs[i].onmouseout = function(){
this.className = this.className.replace(" hover", "");
}
}


{
var select = document.getElementsByTagName("select");
for(var s = 0; s < select.length; s++){
select[s].onmouseover = function(){
this.className += " hover";
}
select[s].onmouseout = function(){
this.className = this.className.replace(" hover", "");
}
}


{
var textarea = document.getElementsByTagName("textarea");
for(var t = 0; t < textarea.length; t++){
textarea[t].onmouseover = function(){
this.className += " hover";
}
textarea[t].onmouseout = function(){
this.className = this.className.replace(" hover", "");
}
}

{
var inputs = document.getElementsByTagName("input");
for(var i = 0; i < inputs.length; i++){
inputs[i].onfocus = function(){
this.className += " focus";
}
inputs[i].onblur = function(){
this.className = this.className.replace(" focus", "");
}
}

{
var select = document.getElementsByTagName("select");
for(var s = 0; s < select.length; s++){
select[s].onfocus = function(){
this.className += " focus";
}
select[s].onblur = function(){
this.className = this.className.replace(" focus", "");
}
}

{
var textarea = document.getElementsByTagName("textarea");
for(var t = 0; t < textarea.length; t++){
textarea[t].onfocus = function(){
this.className += " focus";
}
textarea[t].onblur = function(){
this.className = this.className.replace(" focus", "");
}
}

}
}
}
}
}
}

I'm thinking I might need to name the function and also call it from the
<body> meaning window.onload will not be used in the script.

It seems what is happening is  that as the page loads, since the
different elements haven't been established yet, the focus_js.js script
can't set the class names.  If I include the "defer" attribute, the
script waits until the elements are loaded but then overlib and
recoverinputs don't work.  See this link
http://dean.edwards.name/weblog/2005/09/busted/ , it discusses onload
event issues amongst the different browsers and ways to overcome those
differences.

BTW this pertains to the same form page from my previous post.

Your input as always is appreciated,

John

#603 From: "Foteos Macrides" <fote@...>
Date: Mon Feb 20, 2006 5:17 pm
Subject: Re: Onload event call to overlib (was: Problem with flash ...)
oldgreeky
Send Email Send Email
 
----- Original Message -----
From: docdudeus
. . . As for the other issue with the conflict, I removed the return [token] and now both functions are fired off. For my own education why is the return not necessary for an onload event but is for onmouseover or onclick?  I'm not sure I understand.  Is it the internal code that requires returning a function state for the latter events which is not required for the onload event?
John,
 
The overlib function uses self.status (equivalent to window.status) to set the statusline when the STATUS, AUTOSTATUS or AUTOSTATUSCAP command is included in the overlib call.  The IE browser was originally developed with a quirk that persists through its version 6 (don't know about IE v7 which is currently in field testing) such that if self.status (or window.status) is invoked via onmouseover, then the overall javascript must return true for the statusline to be changed as instructed.  The geckos and most other browsers emulate that quirk / requirement, but it does not apply in any browser to onload, onclick or other events via which the overlib function might be called.  The overlib function therefore returns true for IE and most other browsers when STATUS, AUTOSTATUS or AUTOSTATUSCAP was included, and otherwise returns false.  It returns false in the latter case (i.e., when it does not use self.status) because when overlib is called via onclick you most commonly require that return value for reasons discussed recently in the thread which ends with:
 
 
One does not normally include STATUS, AUTOSTATUS or AUTOSTATUSCAP in overlib calls via onclick, so that usually works out for those "general" users who always precede the overlib call with a return token.  But sometimes a user does include one of those commands in an overlib call via onclick, yielding a return value of true and causing problems.
 
Therefore, the current "best use" instructions are to use the return token for overlib calls only when the call is via onmouseover, and otherwise omit it, but usually force a return value of false for calls via onclick as explained in the:
 
 
support document.
 
Fote
--
 

Messages 574 - 603 of 1492   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help