Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder student101's Avatar
    Join Date
    Nov 2007
    Posts
    634
    Thanks
    80
    Thanked 15 Times in 15 Posts

    Question validating javascript onmouseover?

    How to validate the javscript parts?
    I know of the
    Code:
    <!-- // and end in // --> or 
    //<![CDATA[ and end in //]]>
    Using xhtml1-transitional DOCTYPE
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    PHP Code:
    <a href="page.php" onmouseover="showtext('&lt;div style=&quot;padding-left:40px&quot;><a href=\'link1.php\'>Link1</a> | <a href=\'link2.php\'>Link2</a> | <a href=\'link3.php\'>Link3</a></div>','a', 'No')" onmouseout="hidetext()">Page1</a><img src="img/submenu.gif" alt=" " name="a" border="0" /> 
    I managed to get it down to 29 Errors, 28 warning(s) , complaining about;
    character "<" is the first character of a delimiter but occurred as data
    Cheers
    Thanks for your support!
    Update MySQL with checkboxes | Tell A Friend | Delete MySQL with checkboxes

    Give thanks & resolve when done :thumbsup:

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    Have you try on changing ' into &quot;.

    - Changing < into &lt;.

    - Changing > into &gt;.

    Code:
    <a href="page.php" onmouseover="showtext(&quot;&lt;div style=&quot;padding-left:40px&quot;&gt;&lt;a href=\&quot;link1.php\&quot;&gt;Link1&lt;/a&gt; | &lt;a href=\&quot;link2.php\&quot;&gt;Link2&lt;/a&gt; | <a href=\&quot;link3.php\&quot;&gt;Link3&lt;/a&gt;&lt;/div&gt;&quot;,&quot;a&quot;, &quot;No&quot;)" onmouseout="hidetext()">Page1</a><img src="img/submenu.gif" alt=" " name="a" border="0" />
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #3
    Regular Coder student101's Avatar
    Join Date
    Nov 2007
    Posts
    634
    Thanks
    80
    Thanked 15 Times in 15 Posts

    Question

    I've tried that, if changed the menu.php only show the text not the menu any more.
    Not sure why though; Entire menu below:
    PHP Code:
    <div id="menu">
    <
    a href="index.php" onmouseover="showtext('', '', 'No')">Home</a><img src="img/transparent.gif" alt=" " name="f" border="0" /> | <a href="aboutus.php" onmouseover="showtext('&lt;div style=&quot;padding-left:40px&quot;><a href=\'membership.php\'>Membership</a> | <a href=\'invitation.php\'>Invitation</a> | <a href=\'contactus.php\'>Contact us</a></div>','a', 'No')" onmouseout="hidetext()">About us</a><img src="img/submenu.gif" alt=" " name="a" border="0" /> | <a href="training.php" onmouseover="showtext('&lt;div style=&quot;padding-left:120px&quot;><a href=\'courses.php\'>Courses</a> | <a href=\'training_archives.php\'>Archives</a></div>', 'b', 'No')">Training</a><img src="img/submenu.gif" border="0" alt=" " name="b" /> | 
    <
    a href="events.php" onmouseover="showtext('&lt;div style=&quot;padding-left:110px&quot;><a href=\'r_central.php\'>Central</a>  | <a href=\'r_eastern.php\'>Eastern</a> | <a href=\'r_southern.php\'>Southern</a> | <a href=\'events_archives.php\'>Archives</a></div>','c', 'No')" onmouseout="hidetext()">Events</a><img src="img/submenu.gif" border="0" alt=" " name="c" />
     | <
    a href="news.php" onmouseover="showtext('&lt;div style=&quot;padding-left:150px&quot;><a href=\'articles.php\'>Articles</a> | <a href=\'publications.php\'>Publications</a> | <a href=\'news_archives.php\'>Archives</a></div>','d', 'No')" onmouseout="hidetext()">News</a><img src="img/submenu.gif" border="0" alt=" " name="d" /> | 
    <
    a href="links.php" onmouseover="showtext(' ', '', 'No')">Links</a>
    </
    div
    You can test both, your idea below:
    PHP Code:
    <div id="menu">
    &
    lt;a href="index.php" onmouseover="showtext('', '', 'No')"&gt;Home&lt;/a&gt;<img src="img/transparent.gif" alt=" " name="f" border="0" /&gt; | &lt;a href="aboutus.php" onmouseover="showtext('&lt;div style=&quot;padding-left:40px&quot;&gt;&lt;a href=\'membership.php\'&gt;Membership&lt;/a&gt; | &lt;a href=\'invitation.php\'&gt;Invitation&lt;/a&gt; | &lt;a href=\'contactus.php\'&gt;Contact us&lt;/a&gt;</div&gt;','a', 'No')" onmouseout="hidetext()"&gt;About us&lt;/a&gt;<img src="img/submenu.gif" alt=" " name="a" border="0" /&gt; | &lt;a href="training.php" onmouseover="showtext('&lt;div style=&quot;padding-left:120px&quot;&gt;&lt;a href=\'courses.php\'&gt;Courses&lt;/a&gt; | &lt;a href=\'training_archives.php\'&gt;Archives&lt;/a&gt;</div>', 'b', 'No')"&gt;Training&lt;/a&gt;<img src="img/submenu.gif" border="0" alt=" " name="b" /&gt; | 
    &
    lt;a href="events.php" onmouseover="showtext('&lt;div style=&quot;padding-left:110px&quot;&gt;&lt;a href=\'r_central.php\'&gt;Central&lt;/a&gt;  | &lt;a href=\'r_eastern.php\'&gt;Eastern&lt;/a&gt; | &lt;a href=\'r_southern.php\'&gt;Southern&lt;/a&gt; | &lt;a href=\'events_archives.php\'&gt;Archives&lt;/a&gt;</div&gt;','c', 'No')" onmouseout="hidetext()"&gt;Events&lt;/a&gt;<img src="img/submenu.gif" border="0" alt=" " name="c" /&gt;
     | &
    lt;a href="news.php" onmouseover="showtext('&lt;div style=&quot;padding-left:150px&quot;&gt;&lt;a href=\'articles.php\'&gt;Articles&lt;/a&gt; | &lt;a href=\'publications.php\'&gt;Publications&lt;/a&gt; | &lt;a href=\'news_archives.php\'&gt;Archives&lt;/a&gt;</div&gt;','d', 'No')" onmouseout="hidetext()"&gt;News&lt;/a&gt;<img src="img/submenu.gif" border="0" alt=" " name="d" /&gt; | 
    &
    lt;a href="links.php" onmouseover="showtext(' ', '', 'No')"&gt;Links&lt;/a&gt;
    </
    div
    I am going to throw it out there; this is the only part that does not validate, it's javascript not html; does it really matter?

    Cheers
    Last edited by student101; 09-12-2008 at 08:21 AM.
    Thanks for your support!
    Update MySQL with checkboxes | Tell A Friend | Delete MySQL with checkboxes

    Give thanks & resolve when done :thumbsup:

  • #4
    Regular Coder student101's Avatar
    Join Date
    Nov 2007
    Posts
    634
    Thanks
    80
    Thanked 15 Times in 15 Posts
    Chrome CSS Drop Down Menu (v2.4)
    http://www.dynamicdrive.com/dynamici...rome/index.htm
    Could I not use the Chrome CSS Drop Down Menu and make it do what I need?





    Cheers
    Last edited by WA; 06-14-2009 at 04:00 AM.
    Thanks for your support!
    Update MySQL with checkboxes | Tell A Friend | Delete MySQL with checkboxes

    Give thanks & resolve when done :thumbsup:

  • #5
    Regular Coder student101's Avatar
    Join Date
    Nov 2007
    Posts
    634
    Thanks
    80
    Thanked 15 Times in 15 Posts

    Smile

    Please could an Admin or Moderator remove or change the links
    www[dot]socsat[dot]co.za on this thread, please.

    Thank you.
    Thanks for your support!
    Update MySQL with checkboxes | Tell A Friend | Delete MySQL with checkboxes

    Give thanks & resolve when done :thumbsup:


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •