• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

handler for onclick

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello pples!
I have made small code allowing text in a table row to change color on mouse overs, that part goes well but i am havin problems making the link (onclick) part workin, help would be greatly apreciated!
Here's the code
< !DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
< html>
< head>
< title>Untitled Document< /title>
< meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
< /head>
< body bgcolor="#FFFFFF" text="#000000">
< table width="300" border="1" cellspacing="0" cellpadding="0" height="255">
< tr>
< td width="100" height="100">�< /td>
< td width="100" height="100">�< /td>
< td width="100" height="100">�< /td>
< /tr>
< tr>
< td width="100" height="100">�< /td>
< td bgcolor="#FFCC00" width="150" <br /> onmouseover="this.style.color='#ff0000'" <br /> onmouseout="this.style.color='#0000ff'" <br /> onclick="this.href='http://www.altavista.com'"> ***** not working *****
< center>< b>Link1< /b>< /center>
< /td>
< td width="100" height="100">�< /td>
< /tr>
< tr>
< td width="100" height="100">�< /td>
< td width="100" height="100">�< /td>
< td width="100" height="100">�< /td>
< /tr>
< /table>
< /body>
< /html>
[This message has been edited by Gilles Charbonneau (edited June 23, 2001).]
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps if you put some spaces after your angle brackets so that this html doesn't EXECUTE this might be easier to read .
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I an no HTML expert by any means, but I thought that that is what anchor tags are for.
onmouseover="this.style.color='#ff0000'"
onmouseout="this.style.color='#0000ff'"
< center>< b>< a href="http://www.altavista.com">Link1<; /a>< /b>< /center>
You know we have an HTML forum for questions like this. Randy does LOTS more with this stuff than I do.
[This message has been edited by Cindy Glass (edited June 23, 2001).]
 
Gilles Charbonneau
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello again!
thanks for the help but this isnt what i ment
What i wanna do is to make the table row clickable!
------------------
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, the comment about the HTML forum is still valid. Why not post in a forum which specializes in what you're doing?
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

That should cover you. on-click shouldn't have a dash, but this @#$@#$ forum wouldn't take my post.
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Dan, Welcome to the Java Ranch,
we hope you’ll enjoy visiting as a regular however, your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy.
Thanks again and we hope to see you around the ranch!!
Cindy
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving this to the HTML forum.
 
Ranch Hand
Posts: 838
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gilles,
I haven't used this much but have you tried using the <div> tag. I'm not 100% sure if <td> tags use onclick events since I've never had any use of onclicks for this type of case.
Rob
 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
change this.href to window.location
"window.location='http://www.altavista.com'"
 
Can you smell this for me? I think this tiny ad smells like blueberry pie!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic