Jump to content


  • Posts

  • Joined

  • Last visited

carinemaz's Achievements


Newbie (1/7)



  1. That's what I did at first, but since it wasn't working, I assumed I had to leave the elementID ....Even more confused now!
  2. Thank for the code, but....hum.... Been trying to get it to work, but can't figure it out...I know I'm doing something wrong but don't know what? <script type="text/javascript">var obj = document.getElementById('elementId');obj.onmouseover=function(){onMouseOver="writeText('Moulin')"}obj.onmouseout=function(){onMouseOver="writeText(' ')"}</script></head><body><a id="test" href="#">test</a> <p id="desc"></p></body> I've tried with and without the onmouseover between the {} but doesn't make a difference...
  3. I'm still in the process of learning Javascript, and want to learn it using the best practice. So it seems inline elements are not the way to go...I've been working on an image map, and all works, thanks to the help of some of you, but I'd like to get rid of the inline elements "onmouseover" and "onmouseout"... And have my code in an external sheet.Is it possible in this example? Would anyone be willing to show me how to create such a code?The code is a little long, so here is the linkhttp://www.medipsy.com/medecin/implantation.phpThanks in advance for any help or suggestions!
  4. put this in your cssimg {border: none;}
  5. ok, I used your code, and it works on my localhost, but not on the website The table is actually being called by include() and the content is on my sql database... Not sure if it's creating some sort of conflit, or if I'm still doing something wrong... Anyhow it's driving me nuts....Here is the complet code, and the link : http://www.medipsy.com/medecin/medecin.php <!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=iso-8859-1" /><title>MEDIPSY</title><link rel="stylesheet" type="text/css" href="medipsy_m.css" /><link rel="stylesheet" type="text/css" href="dropdownmenu_medipsy.css" /><style type="text/css">#body {width: 930px;}#main {width: 730px;float: right;}#sidebar {width: 140px;float: left;display: block;}table {border-collapse: collapse;}tr:hover, .hilite {background-color: #34339B;color:#FFF;}td {padding: 0 0 0 5px;width: 180px;border: 1px solid #34339B;}.tdentete {font-weight:bold;font-size: 20px;color: #34339B;}.tdtelephone {width: 120px;text-align: center;padding: 0;}.tdtitre {width: 100px;text-align: center;padding: 0;}</style><script type="text/javascript"><!--function getElements(){var rows = document.getElementsByTagName("tr");for (var i = 0; i < rows.length; i++){ rows[i].onmouseover=function(){ this.className += "hilite"; } rows[i].onmouseout = function(){ this.className=this.className.replace("hilite" , ""); } }}//--></script><script language="JavaScript"><!--function SymError(){ return true;}window.onerror = SymError;var SymRealWinOpen = window.open;function SymWinOpen(url, name, attributes){ return (new Object());}window.open = SymWinOpen;//--></script><script type="text/javascript"><!--//--><![CDATA[//><!--sfHover = function() { var sfEls = document.getElementById("nav").getElementsByTagName("LI"); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } }}if (window.attachEvent) window.attachEvent("onload", sfHover);//--><!]]></script></head><body onload="getElements()"><?php include('entete.inc')?><div id="body"><div id="main"><table><tr><td><span class="tdentete">Medecin</span></td><td><span class="tdentete">Clinique</span></td><td class="tdtelephone"><span class="tdentete">Téléphone</span></td><td class="tdtitre"><span class="tdentete">Type</span></td><td class="tdtitre"><span class="tdentete">Pst CME</span></td></tr></table><?phpinclude ('select_medecin.inc')?></div><div id="sidebar"><h3>Afficher la liste par :</h3><form action="#" method="post">Docteurs<input type="radio" checked="checked" onclick="window.location.href='medecin.php?typetri=1'" /><br/>Cliniques<input type="radio" onclick="window.location.href='medecin.php?typetri=2'" /></form></div> <?phpinclude('pied2page.inc')?> </div></body></html><script language="JavaScript"><!--var SymRealOnLoad;var SymRealOnUnload;function SymOnUnload(){ window.open = SymWinOpen; if(SymRealOnUnload != null) SymRealOnUnload();}function SymOnLoad(){ if(SymRealOnLoad != null) SymRealOnLoad(); window.open = SymRealWinOpen; SymRealOnUnload = window.onunload; window.onunload = SymOnUnload;}SymRealOnLoad = window.onload;window.onload = SymOnLoad;//--></script>
  6. no... unfortunatly, still not working...
  7. huh...never mind thoes bottom lines....I figured out I didn't have to apply the class to my tr tag...But still, can't get it to work
  8. cause it's not working... <script type="text/javascript">var rows = document.getElementsbytagname("tr");for (var i=0; i <rows.length; i++) {rows[i].onmouseover=function() {this.className += " hilite";}rows[i].onmouseout=function() {this.className=this.className.replace("hilite" , "");}}</script> I'm trying to create a hover effect for IE6, in a table.When I apply the class .hilite to my tr tag, the row looks the way it should look when I hover over it... and when I do mouseover nothing happens...Any suggestions?Thanks
  9. That was easy to fix!!!Thanks, works great!
  10. didn't see your reply...Will try changing the order, thanks!
  11. Thanks for your response.I am calling an entire page...The whole thing works fine if I just call one page... say the form page. But as soon as I put the "include" in the if statements to call two different pages, it bugs... I don't know how to do it any other way...
  12. Hi all,I'm having problems displaying properly my pages once you hit the submit button on my form...Here is the code <form class="form" action="message_rep.php" method="post"> <p><label for="nom">Nom :</label><input type="text" name="nom" size="30" /></p> <p><label for="email">Email :</label><input type="text" name="email" size="30" /></p> <p><label for="objet">Objet :</label><input type="text" name="objet" size="30" /></p> <label for="message">Message :<br /><textarea rows="10" cols="40" name="message"></textarea> <p><input type="submit" value="Soumettre" class="input" /></p> </form> <?php$nom=$_POST['nom'];$email=$_POST['email'];$objet=$_POST['objet'];$message=$_POST['message'];$message_bis= "Vous avez oublié de remplir : " ;if (empty($nom)) : $message_bis= $message_bis . " Nom";endif;if (empty($email)) : $message_bis = $message_bis . " Email";endif;if (empty($objet)) : $message_bis= $message_bis . " Objet";endif;if (empty($message)) : $message_bis= $message_bis . " Message";endif;if (empty($nom) or empty($email) or empty($objet) or empty($message)) : echo "<script type='text/javascript'>\n"; echo "alert('$message_bis');\n"; echo "</script>";include('message.php');else : $envoyer_vers='patricia@medipsy.com'; $delapartde='from: patricia@medipsy.com'; $contenu_message = 'Nom : '.$nom."\n". 'Email : '.$email."\n". 'Message : '.$message."\n"; mail($envoyer_vers, $objet, $contenu_message, $delapartde); $message_bis= "Votre message a bien été envoyé. " ; echo "<script type='text/javascript'>\n"; echo "alert('$message_bis');\n"; echo "</script>";include('index.php');endif;?> Depending if you've filed the form correctly or not, you get redirected to a different page. If all fields are filed, you go back to the index, if not, back to the form page....In order to do that, I've put my include() in the if or else statement, but by consequence, when you hit submit, the popup window comes up with a blank page in the back, and for whatever reason, when you click ok, my content is no longer centered...I'd like my form page to stay up when the popup window comes up... And figure out why my content gets shifted to the left....Hope my explanations make sense?Any solutions?
  13. Great!!!!Thanks a lot for your time!
  14. Thanks Scott,but it doesn't work....here is the link:http://www.medipsy.com/medecin/implantation.php
  15. Hi all!Is it possible to apply different styles to text that is called by onmouseover in an images map?say I'd like the first one "Pen An Dalar" in blue, and the second one "Moulin" in red...How do I add the css??I've tried to add an <h1>, like they show in the tutorials.... but not workinghere is the code... <head><style type="text/css">#desc {font-family: Arial, Helvetica, sans-serif;font-size: 16px;font-weight: bold;color: #34339B;}</style><script type="text/javascript">function writeText(txt){document.getElementById("desc").innerHTML=txt}</script></head><body><div id="main"><img src="images/carte-medipsy.gif" alt="Emplacement des Etablissements MEDIPSY" border="0" usemap="#Map" title="Emplacement des Etablissements MEDIPSY" /><map name="Map" id="Map"> <area shape="rect" coords="5,132,26,153" href="#" alt="Pen An Dalar" onMouseOver="writeText('Pen An Dalar\n Directeur:\n Jean LE MARTRET\n147, rue de Paris\n29490 GUIPAVAS\nTel: 02 98 84 76 25\n Fax: 02 98 84 88 92')" onmouseout="writeText(' ')" /> <area shape="rect" coords="97,161,116,176" href="#" alt="Moulin" onMouseOver="writeText('Moulin\n Directrice:\nJoelle MODE\nCarcé BP 7138\n35171 BRUZ Cedex\nTel: 02 99 05 05 05\n Fax: 02 99 05 05 99')" onmouseout="writeText(' ')" /> <p id="desc"></p></div></body></html>
  • Create New...