thescientist Posted August 23, 2009 Share Posted August 23, 2009 Hey, I'm teaching myself Javascript to prepare for the new web job I'll starting soon, and I'm having some frustrations while trying to get my pages to validate. I've done a bunch of exercises and wanted to compile them into my own little "reference app" but before that happens I want to make sure all the examples I'm collecting from this book are valid, but I keep running into errors when it comes to form elements. (It was published in 2007, so it's not that old) as far as standards go.) The javascript code works fine and everything, but just will not validate. For example...http://www.analogstudios.net/javascript_re.../example_3.htmlI've used form elements in other websites (using the same DTD AND with PHP in them) and gotten it validate, but I'm not sure why it won't work now. Also, it says "name" isn't a valid property for <form>, but if I use "id=" then the javascript won't work. Newbie stuff I know, but I want to be one step ahead of the game for a couple of weeks from now.anyway, thanks for any help! Link to comment Share on other sites More sharing options...
jeffman Posted August 23, 2009 Share Posted August 23, 2009 Don't try to get a reference to the form this way:document.theformGiveDo it like this:document.getElementById(my_form_id)And get a new book. That one may not be old, but it's hopeless. Link to comment Share on other sites More sharing options...
thescientist Posted August 23, 2009 Author Share Posted August 23, 2009 oh really? haha. My bad. Although I kind of had that inclination anyway, but since I'm new to Javascript, I have no real way to tell whats good or bad yet. Luckily, based on a couple of recommendations, I have already ordered two other books which hopefully should be arriving soon. I suppose the "learn it in 24 hours" is a sign that it may not have been the best to go with? java script: The Definitive Guidejava script: The Good Parts Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.