You are currently viewing the BOOK: Professional Ajax 2nd Edition ISBN: 978-0-470-10949-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
first of all sorry if I explain myself badly but I am not a Shakesperean Native ;).
Ok here it is :
Chapiter 2 of the Book :
I am trying to use a Post Form in ajax, it works well, untill I include it with other files.
Let me explain better :
I got SaveCustomer.php plus and the XMLHttpExample2.htm (this one with the POST).
All together they work fine.
But when I try to include the XMLHttpExample2.htm with header.php and footer.php in a common php file, when I try it without giving my name for example it take the header + the htm file + the footer inside the DivStatus <div>, what can I do to show only an error message ???
I could show you if you need to see what happen in a screenshot, the prob is that I think it get the <body></body> and print it instead of giving only the error message !!!
Without knowing exactly what you're doing or what the exact error is, it's hard to know why you're having trouble. My hunch is that including these various files using one PHP creates an invalid HTML file (perhaps having two sets of <html> and <body> tags), which confuses the JavaScript. View the source of the page when you load it in the browser and see if you notice any problems with the HTML. If you can be sure that the HTML is valid, your errors will probably go away.
Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088) http://www.nczonline.net/
I think i found the error, the prob is that it in the menu.inc.php there is another form, is there a way to identify each ones ???
Because with 2 forms the code doesn't work, is it possible to name the form for example <form name="ins" ...> and to indicate to the script that you have to get values from the form named ins ???