TekRat wrote:
I fixed the problem, it was dumb and had everything to do with arrangement and the fact I was using name="" instead of id=""
*facedesk*
Are you using jQuery? jQuery makes javascript so much easier. Here are tips for javascript and HTML:
- Seriously, use id over name. HTML id's are unique to the element, name is a deprecated feature (IIRC).
- Learn how the
DOM tree operates. HTML is heavily dependent on DOM traversals. It's not as hard as you think and it'll make you quick on the draw when writing javascript.
- Use a nice framework like jQuery, suppose you have a textbox that you need to populate:
Code:
var d = document.getElementById("myTextBox");
d.value = 'Some value';
jQuery short hands this:
Code:
$("#myTextBox").val('some value');
jQuery is the future of javascript and it's worth learning. I use it pretty heavily in projects, it makes AJAX calls a LOT simpler.
- Learning Javascript is a must in web development, invest some time in learning it.