PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Dec 12, 2018 1:00 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: PHP and javascript
PostPosted: Mon Jun 17, 2002 4:08 pm 
Offline
Forum Newbie

Joined: Thu Jun 13, 2002 9:44 am
Posts: 6
I am trying to hide a URL onMouseOver within PHP. I keep getting runtime errors. I have tried many things, but nothing works. All I want to do is hide my URL on mouseovers. The information is stored in a MySQL database.

Here's what it looks like

----the javascript-----
<script language="JavaScript">
function displayStatusMsg(msgStr) {
status=msgStr;
document.returnValue = true;
}
</script>

-----the variable------
$msgs=$row["name"];


-----the echo statement-----
echo "<a href='$link' onMouseOver='displayStatusMsg($msgs)';return document.returnValue>"."Click Here"."</a>";


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 17, 2002 4:22 pm 
Offline
Forum Regular
User avatar

Joined: Fri May 03, 2002 3:33 am
Posts: 512
Location: Edinburgh, Scotland
Try

onMouseOver='javascript:displayStatusMsg($msgs)'...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 17, 2002 7:43 pm 
Offline
Forum Contributor

Joined: Sat Jun 15, 2002 3:58 pm
Posts: 130
Use a normal link:

<a href="page.html" onMouseOver="window.status='text'; return true">

where text is what you want to appear in the status bar. If you just want it to appear blank, put this in:

<a href="page.html" onMouseOver="window.status=''; return true">

If that was in PHP, it would be a simple print/echo command.


Top
 Profile  
 
 Post subject: Re: PHP and javascript
PostPosted: Tue Jun 18, 2002 8:30 am 
Offline
Forum Newbie
User avatar

Joined: Fri Jun 14, 2002 1:48 pm
Posts: 16
BuzzT wrote:
echo "<a href='$link' onMouseOver='displayStatusMsg($msgs)';return document.returnValue>"."Click Here"."</a>";


Don't forget that when you're echoing the variables it's going to print out whatever is in teh variable. So what sending the text as a parameter to the javascript you'll need to encase it in quotes, such as:

Syntax: [ Download ] [ Hide ]
echo "&lt;a href="$link" onMouseOver="displayStatusMsg('$msgs'); return document.returnValue"&gt;Click Here&lt;/a&gt;";


Andy


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group