javascript elements is undefined

SeQ

New Member
When I load vote.php on my web browser instead of index.php, I was able to vote and display user statistic. However I decided to implement the poll system by adding include('vote.php') to index.php, my document.forms[0] from vote.js can detect how many radio buttons in vote.php but I having problem getting this code working that appear to be "undefined" or not able to response, I did not modify any code all time:JS code:\[code\]var objForm = objForm.elements['vote[' + pollId + ']'];\[/code\]pollId is an integer type with value of '1' which is Poll question 1;When I tried to trace using \[code\]objForm.elements\[/code\], it could show exact numbers of radio buttons I have implemented in HTML in the poll.I need the solution to be "objForm.elements.vote[1]" before I could loop and detect which option did the user select.
 
Back
Top