Jump to content

davej

Moderator
  • Posts

    3,988
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by davej

  1. Maybe you are thinking of this... <area shape="rect" coords="252,308,274,342" alt="35" href="dbcon.php?a=0104020201"> <area shape="rect" coords="418,326,435,355" alt="111" href="dbcon.php?a=0104020101"> http://www.w3schools.com/tags/att_area_shape.asp
  2. You can paste into a code block...
  3. davej

    style tag <figure>

    Using the image and text from this example: http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_figcaption <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>test</title> <style> *{ margin:0; padding:0; } figure{ display:inline-block; margin:10px; } </style> </head> <body> <p>The Pulpit Rock is a massive cliff 604 metres (1982 feet) above Lysefjorden, opposite the Kjerag plateau, in Forsand, Ryfylke, Norway. The top of the cliff is approximately 25 by 25 metres (82 by 82 feet) square and almost flat, and is a famous tourist attraction in Norway.</p> <figure> <img src="img_pulpit.jpg" alt="The Pulpit Rock" width="304" height="228"> <figcaption>Fig.1 - A view of the pulpit rock in Norway.</figcaption> </figure> <figure> <img src="img_pulpit.jpg" alt="The Pulpit Rock" width="304" height="228"> <figcaption>Fig.1 - A view of the pulpit rock in Norway.</figcaption> </figure> <figure> <img src="img_pulpit.jpg" alt="The Pulpit Rock" width="304" height="228"> <figcaption>Fig.1 - A view of the pulpit rock in Norway.</figcaption> </figure> <p><strong>Note:</strong> The figure tag is not supported in Internet Explorer 8 and earlier versions.</p> </body> </html>
  4. So you didn't write this code and you don't understand it? It seems to put a style block in the middle of the html, which is illegal. The style block should go inside the file head. The ! is the logical negation operator in Php and most modern languages.
  5. Obvious error here: if (empty($_POST[email'])) {
  6. I believe the closing slash at the end of singular tags has always been optional but it was required in XHTML. In HTML5 it is clearly stated that this slash is optional, but in HTML5 a lot of stuff is optional -- to such an extent that most code-writers refuse to produce the horrible-looking stuff that HTML5 will accept as perfectly legal.
  7. Because some tags (such as <input/> and <img/> and <br/> and <hr/>) are singular tags and have no legal closing tags. Browsers are designed to be forgiving and they try to make sense of illegal syntax, however HTML validators are designed to be precise and unforgiving. <button id="btn1">Press Here</button> <input type="button" id="btn2" value="Press Here"/>
  8. Why not create a small example that demonstrates your problem and then paste the code into a code block? // this is a code block
  9. If you are talking about this page... http://www.w3schools.com/browsers/ ...and you feel the information on the page is inaccurate, then go to the bottom of that page and click the link "REPORT ERROR."
  10. You could try something like this. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>title</title> <style> .highlight{ color:#0ff; background-color:#ddd; } </style> <script> var highlight; window.onload = cycle; function cycle(){ var str; var list = document.getElementById('navbar').getElementsByTagName('A'); if(highlight != undefined){alert('list['+highlight+'].className='+list[highlight].className);} if (highlight === undefined){ highlight = -1; }else if (highlight === list.length-1){ if (list[highlight].className.indexOf('highlight') != -1){ str = list[highlight].className.replace('highlight',''); list[highlight].className = str; highlight = -1; }else{ highlight = -1; } }else{ if (list[highlight].className.indexOf('highlight') != -1 ){ str = list[highlight].className.replace('highlight',''); list[highlight].className = str; } } highlight++; if (list[highlight].className.indexOf('highlight') != -1 ){ // do nothing }else{ list[highlight].className += ' highlight'; } setTimeout(cycle,500); } </script> </head> <body> <div id="navbar"> <ul> <li><a>Link1</a></li> <li><a>Link2</a></li> <li><a>Link3</a></li> </ul> </div> </body> </html>
  11. It would be easy enough to accomplish with Javascript.
  12. The problem is your color will always be orange, because paintComponent() sets the color to blue but then immediately sets it back to orange. You need paintComponent to set a desired color... public class MyDrawPanel extends JPanel { int color = 0; public void setColor(int c){ color = c; } public void paintComponent(Graphics g){ if (color == 0){ g.setColor(Color.blue); } else if (color == 1){ g.setColor(Color.orange); }else{ g.setColor(Color.red); } g.fillOval(70, 70, 100, 100); } } //declare drawpanel outside of go() public void actionPerformed(ActionEvent e){ drawpanel.setColor(1); frame.repaint(); }
  13. It sounds like you just want to do this only for the sake of appearance? Perhaps you should look at CSS3 animations. http://www.w3schools.com/css/css3_animations.asp
  14. Can you provide a small example that includes the HTML?
  15. This might be closer to what you want. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="description" content="MAJESTIC Car Rental Website Project" /> <meta name="keywords" content="HTML5, CSS2.1, CSS3" /> <meta name="author" content="Enquiry Form" /> <script> function chk(idfield) { var fieldvalue = document.getElementById(idfield).value.trim(); var errmsg = ""; if (fieldvalue == "") { errmsg += "Field cannot be empty!"; } else if (!isNaN(fieldvalue)) { errmsg += "Field cannot be numbers!"; } else if ( !fieldvalue.match(/^[a-zA-Z]+$/) ) { errmsg += "Field has bad characters!"; } else if (fieldvalue.length > 25) { errmsg += "Field cannot be more than 25 characters!"; } return errmsg; } function norml(idfield, iderrfield) { document.getElementById(idfield).style.color = ''; document.getElementById(iderrfield).innerHTML = ''; document.getElementById(idfield).onkeyup = ''; } function validate() { var fnerrors = chk("fn"); if (fnerrors != ""){ var field1 = document.getElementById("fn"); field1.style.color = '#f00'; field1.onkeyup = function(){ norml( "fn", "fnerrs" );}; } var lnerrors = chk("ln"); if (lnerrors != ""){ var field2 = document.getElementById("ln"); field2.style.color = '#f00'; field2.onkeyup = function(){ norml( "ln", "lnerrs" );}; } if (fnerrors != "" || lnerrors != ""){ document.getElementById("fnerrs").innerHTML = fnerrors; document.getElementById("lnerrs").innerHTML = lnerrors; return false; //prevent form submission if error was detected }else{ alert('allowing form submission'); } } function init() { document.getElementById("enqForm").onsubmit = validate; } window.onload = init; </script> <title>MAJESTIC ENQUIRIES</title> </head> <body id="enquire"> <!-- BEGIN SECTION --> <section id="form"> <div> <form id="enqForm" method="POST"> <div class="formobj"> <div id="enquiry"><h1>CUSTOMER ENQUIRIES</h1></div> <table><tr> <td><input id="fn" type="text" name="firstname" placeholder="First Name *" /></td> <td><input id="ln" type="text" name="lastname" placeholder="Last Name *" /></td> </tr><tr> <td style="color:#f00;" id="fnerrs"></td> <td style="color:#f00;" id="lnerrs"></td> </tr></table> <input id="sendbutton" type="submit" value="Enquire" /> </div> </form> </div> </section> </body> </html>
  16. Did you go through the DOM tutorial? http://www.w3schools.com/js/js_htmldom.asp
  17. So float both paragraphs. I don't see width or height affecting the float property. If you don't declare a width and height an element will still have the default values. If you put a border around each element you can more easily see where their boundaries are. Float removes a element from the normal flow.
  18. It is useful to put absolutely positioned items inside a relative container. https://www.google.com/?gws_rd=ssl#q=css+absolute+positioning+inside+relative
  19. The Java JDK includes the compiler, and you can write programs in a text editor, but most people use an IDE such as Netbeans or Eclipse. http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html#javasejdk
  20. davej

    Meta data

    Metadata is information about the data. When you set up a database table and say that a certain field must be a positive integer that is metadata. https://en.wikipedia.org/wiki/Metadata
  21. I don't have the statistics but ordinary low-cost shared-hosting accounts can't use certificates unless they use the shared server certificate.
  22. Make a copy and step through the copy. var lst = document.blahblah var len = lst.length; for(var i=0 ; i<len ; i++){ if(lst[i] == ???){ // etc } }
  23. Code errors sometime halt execution before e.preventDefault() is reached.
×
×
  • Create New...