PDA

View Full Version : onMouseover



gully
June 18th, 2008, 13:25
What i am trying to do is

So test in the toolbox message and show Your Sub Accounts in the title it works in html but not in php the User 1 is coming up in the title.

Here is the code that works in html
onmouseover="showToolTip('Name','Please enter your name here.',event);" onmouseout="hideToolTip();"


//////////////////////////////////////////////////////

This code dose not work.
$test1 = "User 1";
$test2 = "Sub Accounts";
$sub_account = "<a href='#' onMouseover='showToolTip(\"Your Sub Accounts," . $test1 . ",\")'>" . $test2 . "</a>";

echo "$sub_account";

Can some one try and help me please thank you.

themoose
June 18th, 2008, 13:31
$sub_account = "<a href=\"#\" onMouseover=\"showToolTip('Your Sub Accounts," . $test1 . ",')\">" . $test2 . "</a>";

Should work.

gully
June 18th, 2008, 18:45
Sorry that is still doing the same thing

JonnyH
June 19th, 2008, 04:56
What's it doing?

Dynash
June 19th, 2008, 08:18
Not working :p

DarkBlood
June 20th, 2008, 08:22
Don't use ShowToolTip on anchors; also don't echo $sub_account as a string.


// This code "dose" work.
$test1 = 'User 1';
$test2 = 'Sub Accounts';
$sub_account = '<a href="#" title="Your Sub Accounts, '. $test1 .'">'. $test2 .'</a>';

echo $sub_account;

But I don't think "title" is valid (It is valid in XHTML 1.0 Trans and valid HTML 4.01 Trans). You can see it in action (http://iyeru42.info/test) as well (the file will be removed by next week some time.)

JohnN
June 20th, 2008, 09:07
mentok was nearly there:

$sub_account = "<a href='#' onMouseover=\"showToolTip('Your Sub Accounts, $test1');\">$test2</a>";

gully
June 23rd, 2008, 21:42
Thank you for your help :>

iBrightDev
June 24th, 2008, 01:32
$sub_account = "<a href='#' onMouseover='showToolTip(\"Your Sub Accounts," . $test1 . ",\")'>" . $test2 . "</a>";

since you are calling variables test1 and test2, adn you have started the line with double quotes, you do not need to put the double quotes and the period like you have done around test on and test 2. if you do like to see the variables called out like that, then use single quotes like this...


$sub_account = '<a href="#" onMouseover="showToolTip(\'Your Sub Accounts, '.$test1.'\');">'.$test2.'</a>';

otherwise, stay with double quotes like JohnN showed.


$sub_account = "<a href=\"#\" onMouseover=\"showToolTip('Your Sub Accounts, $test1');\">$test2</a>";

gully
July 16th, 2008, 22:27
Sorry i forgot to say thank you :)