Jump to content
Larry Ullman's Book Forums

Magnus

Members
  • Content Count

    10
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Magnus

  • Rank
    Newbie
  1. Hi Larry, Of course you are right, I was so faithful to your original code that I didn’t make the change to “onsubmit”. Now it is all working :-) Then I have two contributions to your collection of errata for chapter 11. 1. content.html line 18 id="Comments" should be id="comments" (without capital C) otherwise line 48 in script contact.js does not work. 2. As you pointed out; line 25 in contact.js should be: document.getElementById('theForm').onsubmit(); Thanks! Magnus (This is the 4th of your books that I am reading, and I am eager to get my hands on your next: “PHP Advanced and Object-Oriented Programming”!!!)
  2. Hi Larry, Thanks for your answer. I don´t know what happened, but now it is working. I have run the HTML page with the help of Wampserver, like all the other exercises. Yesterday and this morning it didn´t work, but now it is... I am normally using FireFox, and the error messages comes from the little red X to the right in Web Developer Toolbar. But I am also using Chrome, and sometimes Safari... But the conflict with id="submit" remains. I changed the status code check in contact.js to force an error, and then I get this error message: "document.getElementById("theForm").submit is not a function" but if I change the id name in the form to id="btnSubmit" it works fine. / Magnus
  3. I found the origin of Error 3: It is a conflict between the name id="submit" in the form, and the function submit() on line 25 in the script contact.js. If I rename the id in the form to id="btnSubmit" that error dissapears. I also have to change in the sylesheets; but I dont know if the renaming can have other consecueses. But main error # Error 2 above is still very live and active ;-)
  4. I have found one error: contact.html, line 51, id="Comments" should not have capital C => id="comments" But when I corrected that then I get 2 new errors that I have not been able to sort out: # Error 2 Syntax Error file:///C:/wamp/www/larry/jsdd/ch11/resources/contact.php Line: 4, column: 3 Source code: ?>The message has been sent. # Error 3 document.getElementById("theForm").submit is not a function file:///C:/wamp/www/larry/jsdd/ch11/js/contact.js Line: 25
  5. HartleySan, It is the example with contact.html that I have problem with, all other examples works fine. What I expect is that after entering name, email, some text in the comment field, and click on the submit button, the form should be replaced by the text "The message has been sent." from the script contact.php in the folder "resources". But the only thing that happens is that the form is reset. / Magnus
  6. Hi HartleySan! I downloaded all the code from Larrys site when I started to read the book. When I ran into this problem I noticed that there was a new update as of 13th of June. I downloaded the new code and tried again, but it does not work. / Magnus
  7. Hi, This book explains everything well and the examples are working fine, as does all Larrys books :-) But now I have come to a full stop… I am not able to make the Ajax contact form work (page 456-460). Do I have to complete the php script or does the example (normally) work out of the box? I have downloaded the latest update of the code from Larrys website. I have Wampserver on Windows, and have tested in Chrome and FireFox. I have also tested Larrys debugging techniques, like eating some fruit and go for a walk, but nothing helps ;-) Can anyone help me in the right direction? Thanks! Magnus
  8. Now I have found the problem, and the solution... The problem was that I had not set up WAMP with virtual hosts. The solution was a good tutorial (http://cesaric.com/?p=255) on how to set up virtual hosts in WAMP; and now the site works :-) /Magnus
  9. Hi Larry, This is the second of your books I am reading; the reason why I did not register in the Forum before is that this is the first time I have run into problems :-) I learned PHP from your book PHP and My SQL for Dynamic Web Sites, 2nd edition. I definitely will buy the new edition as soon as it comes out to update my knowledge. Thanks for translating Geek into English! I placed the files in C:wamp/www/ecom2/html Here is how I tried to define the paths in the config file: define ('BASE_URI', 'C:\wamp\www\ecom2\\'); define ('BASE_URL', 'localhost\ecom2\html\\'); define ('MYSQL', BASE_URI . 'mysql.inc.php'); I think the BASE_URI is ok, because the database is connected, but looses contact if I change the BASE_URI. I have tried various different solutions for the BASE_URL, without success... And here is the URL I am using: http://localhost/ecom2/html/ Example from the header: This is not working: <link href="/css/style.css" rel="stylesheet" type="text/css" /> This is working: <link href="./css/style.css" rel="stylesheet" type="text/css" /> This is working: <link href="css/style.css" rel="stylesheet" type="text/css" /> Thanks! Magnus
  10. Hi, I have just started reading part 3 of the book and downloaded the code; but I have trouble with the absolute referenced links. I am using WAMPSERVER on Windows XP, PHP 5.2.11, Apache 2.2.11, and MySQL 5.1.36. I did not have any problem with the first site, or with any other site... but this is the first time for me with absolute references. If I do as Larry says on page 185 that one should not do, adding a dot before the slash or stripping the first slash, it works. But I understand that this will cause problems with the mod rewrite later... Has anyone run into the same problem, and managed to solve it? Thanks! Magnus
×
×
  • Create New...