•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 391,906 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,583 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 2523 | Replies: 1
![]() |
•
•
Join Date: Dec 2006
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
In html i have some question, and the answers are radio buttons ...
the names of variables in html are array ... like question[1], question[2] ... etc.
and every question has multiple value, depending of the answer.
[html]<form action="thx.php" method=POST name=form onSubmit="return check(this)">[/html]
In javascript i have to determinate if the question is answered, if it is not then return false ...
Everything work fine until i changed my variables into arrays.
What is wrong now?
How javascript handle two dimensional array?
pls help
the names of variables in html are array ... like question[1], question[2] ... etc.
and every question has multiple value, depending of the answer.
[html]<form action="thx.php" method=POST name=form onSubmit="return check(this)">[/html]
In javascript i have to determinate if the question is answered, if it is not then return false ...
function check(form) {
a=0;
for (i=0;i<form.question[1].length;i++){
if (form.question[1][i].checked===true) {a=1;}
}
if (a==0) {
alert("question[1] no.1: You didn't answer the question");
return false;
}
}Everything work fine until i changed my variables into arrays.
What is wrong now?
How javascript handle two dimensional array?
pls help
•
•
Join Date: Jul 2006
Location: Deptford, London
Posts: 936
Reputation:
Rep Power: 5
Solved Threads: 47
O_o maybe javascript doesn't do what you think it does... or maybe that's too incomplete a code snippet to see what your trying to do. forms.question[1] doesn't look like a DOM object reference.. and it wont neccessarily relate to any input element(s) on your HTML page...
what is the HTML code you are using?
what is the HTML code you are using?
If it only works in Internet Explorer; it doesn't work.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
- two dimensional array (C)
- 2 dimensional array class (C)
- multi dimensional array search xml parser (PHP)
- Need help passing a multi-dimensional array (C++)
- Trying to create a method to convert string letters into a two dimensional array (Java)
- Need Help With two-dimensional array (VB.NET)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: HELP reg:: Dynamic Dependant Dropdown
- Next Thread: Text selection disabled..plz help


Linear Mode