Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP.NET (Non-Forum Related)
 "on mouse over" problem
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

Alfred
Senior Member

USA
1527 Posts

Posted - 12 December 2003 :  23:48:18  Show Profile  Visit Alfred's Homepage
An image is placed with the function "DisplayMedalIcon". I would like to show an alt="data from db" when hovering over the image.
The red part was my guess, but naturally, doesn't do the trick.
quote:
response.write DisplayMedalIcon(myMedalMembers("member_id"))& alt="myMEDALMembers("scenario")" & "</td></tr><tr><td>"
How is that done correctly?

Alfred
The Battle Group
CREDO

laser
Advanced Member

Australia
3859 Posts

Posted - 12 December 2003 :  23:52:29  Show Profile
What does DisplayMedalIcon do ?

And this isn't .Net, it's just plain ASP
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 13 December 2003 :  11:51:30  Show Profile
you probably need to add the alt part to your DisplayMedalIcon function.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 13 December 2003 :  12:15:58  Show Profile  Visit Alfred's Homepage
quote:
Originally posted by laser

What does DisplayMedalIcon do ?

It puts the medal graphic there.
quote:
And this isn't .Net, it's just plain ASP

you lost me here!

Alfred
The Battle Group
CREDO
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 13 December 2003 :  12:23:27  Show Profile  Visit Alfred's Homepage
quote:
Originally posted by Nikkol

you probably need to add the alt part to your DisplayMedalIcon function.

That is what I was thinking as well (truely, I did!), but the function has more than a dozen variations, and does not have the variable myMEDALMembers("scenario") available.
I am uploading the txt.file for it: http://www.ggholiday.com/bg/forums/decorated.txt

The "alt=" should should the scenario name and date of issue, from the data base.

Alfred
The Battle Group
CREDO
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 13 December 2003 :  12:38:04  Show Profile  Visit Alfred's Homepage
I tried to move the function down below where the varable is introduced, and did this:
quote:
if mymedals("medal_ID") = 8 then
DisplayMedalIcon = DisplayMedalIcon & "<img border=""0"" src=""../images/gold.gif"" width=""66"" height=""90"" alt=""myMEDALMembers("scenario")"">"
end if
for each of the medals.
But I get the "expected end of statement" error.

Alfred
The Battle Group
CREDO
Go to Top of Page

snaayk
Senior Member

USA
1061 Posts

Posted - 13 December 2003 :  13:55:11  Show Profile  Visit snaayk's Homepage  Send snaayk an AOL message  Send snaayk an ICQ Message  Send snaayk a Yahoo! Message
Try this:

Change the function to this:

Function DisplayMedalIcon(m_id, alttext)

Then add the red to all your statements:

DisplayMedalIcon = DisplayMedalIcon & "<img border=""0"" src=""../images/gold.gif"" width=""66"" height=""90"" alt="""&alttext&""">"

Then call the function like this:
DisplayMedalIcon(myMedalMembers("member_id"), myMEDALMembers("scenario"))


Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 13 December 2003 :  15:54:44  Show Profile  Visit Alfred's Homepage
Thank you, snaayk - this worked!

Alfred
The Battle Group
CREDO
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 13 December 2003 :  16:15:38  Show Profile  Visit Alfred's Homepage
Except that I miscoded this line now:
quote:
[response.write DisplayMedalIcon(myMedalMembers("member_id"), myMEDALMembers("scenario"), myMedalMembers("medal_date"))
error:
quote:
Error Type:
Microsoft VBScript runtime (0x800A01C2)
Wrong number of arguments or invalid property assignment: 'DisplayMedalIcon'
/BG/forums/decorated.asp, line 106


Alfred
The Battle Group
CREDO
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 13 December 2003 :  16:33:21  Show Profile
you have three arguements in your call, but only two in the function definition.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 13 December 2003 :  16:35:16  Show Profile
quote:
Originally posted by Alfred

quote:
Originally posted by laser

And this isn't .Net, it's just plain ASP

you lost me here!


I just mean that you've posted in the .Net forum, but you're not talking about .Net, just classic ASP

quote:

Error Type:
Microsoft VBScript runtime (0x800A01C2)
Wrong number of arguments or invalid property assignment: 'DisplayMedalIcon'
/BG/forums/decorated.asp, line 106


snaayk has redefined your code to accept 2 arguments, now with this code :

quote:

response.write DisplayMedalIcon(myMedalMembers("member_id"), myMEDALMembers("scenario"), myMedalMembers("medal_date"))


you are providing 3 arguments, so you get that error.
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 13 December 2003 :  20:59:33  Show Profile  Visit Alfred's Homepage
Does this not define three definitions?
quote:
if mymedals("medal_ID") = 8 then
DisplayMedalIcon = DisplayMedalIcon & "<img border=""0"" src=""../images/gold.gif"" width=""66"" height=""90"" alt="""&myMedalMembers("scenario") & myMedaLMembers("Medal_date") & """>"
end if
or do you mean this line?
quote:
Function DisplayMedalIcon(m_id, alttext, (myMedalMembers("Medal_date"))

In any event, I updated the txt file: http://www.ggholiday.com/bg/forums/decorated.txt

Alfred
The Battle Group
CREDO

Edited by - Alfred on 13 December 2003 21:18:48
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 13 December 2003 :  21:16:22  Show Profile
No definitions there, just an IF (conditional) about medal #8. But in that code what is the difference between myMedalMembers and myMedal_Members ?
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 13 December 2003 :  21:24:07  Show Profile  Visit Alfred's Homepage
I only see "myMedalMembers", Laser.
It comes from a select statement:
quote:
strSql = "SELECT MEMBER_MEDALS.MEMBER_ID, MEMBER_MEDALS.MEDAL_ID, MEMBER_MEDALS.SCENARIO, MEMBER_MEDALS.MEDAL_DATE, FORUM_MEMBERS.M_NAME, FORUM_MEMBERS.M_COUNTRY FROM FORUM_MEMBERS INNER JOIN MEMBER_MEDALS ON FORUM_MEMBERS.MEMBER_ID = MEMBER_MEDALS.MEMBER_ID order by M_NAME ASC;"
set myMEDALMembers = my_Conn.Execute(strSql)

I think you misread the capitalized L as a _ ?

Alfred
The Battle Group
CREDO

Edited by - Alfred on 13 December 2003 21:25:56
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 13 December 2003 :  21:29:21  Show Profile  Visit Alfred's Homepage
I can't believe it, I made a wild guess, and it works!
quote:
Function DisplayMedalIcon(m_id, alttext, altdate)

Alfred
The Battle Group
CREDO
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 13 December 2003 :  21:30:43  Show Profile
Alfred, a quick lesson in Functions ...

snaayk's code works well, changing the function definition to have 2 arguments. Arguments are always separated by commas, so you get :

Function DisplayMedalIcon(m_id, alttext)


m_id and alttext are what the 2 arguments will be called within the function.

With line 106 you are Response writing the result of the function:


response.write DisplayMedalIcon(myMedalMembers("member_id"), myMEDALMembers("scenario"), myMedalMembers("medal_date"))
                                111111111111111111111111111  2222222222222222222222222   3333333333333333333333333333


So you're trying to pass 3 arguments : ID, scenario and date.

Now if you want 3 arguments, it's easy - change the Function definition line, then reference the argument within the function.
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07