I hope this isn't an inappropriate question for this forum, but I need
some help.
I am developing a Google Maps web application and I'm running into
some strange behavior. I have a group of check boxes that the user
can use to select certain criteria that will be used to search the
database. Here's the relevant section of the HTML page:
<pre>
<p><div class=chkList>Services</p>
<p class="label_checkbox_pairA"><input type="checkbox"
name="CheckAll" onClick="checkAll(form,'Services',checked)" /><label
for="CheckAll">Check All</label></p>
<p><div class=chkList1stClmn>
<p class="label_checkbox_pairc1"><input type="checkbox"
name="Services[0]" value="Referrals=1" /><label
for="Referrals">Referrals</label></p>
<p class="label_checkbox_pairc1"><input type="checkbox"
name="Services[1]" value="Screenings=1" /><label
for="Screenings">Screenings</label></p>
<p class="label_checkbox_pairc1"><input type="checkbox"
name="Services[2]" value="WomensHealth=1" /><label
for="WomensHealth">Women's Health</label></p>
<p class="label_checkbox_pairc1"><input type="checkbox"
name="Services[3]" value="Pediatrics=1" /><label
for="Pediatrics">Pediatrics</label></p>
<p class="label_checkbox_pairc1"><input type="checkbox"
name="Services[4]" value="PreventativeCare=1" /><label
for="PreventativeCare">Preventative Care</label></p>
</div></p>
<p><div class=chkList2ndClmn>
<p class="label_checkbox_pairc2"><input type="checkbox"
name="Services[5]" value="Dental=1" /><label for="Dental">Dental</
label></p>
<p class="label_checkbox_pairc2"><input type="checkbox"
name="Services[6]" value="MentalHealth=1" /><label
for="MentalHealth">Mental Health</label></p>
</div></p>
</div></p>
</pre>
When I click on the button to execute a javascript function I use the
following to prepare the data.
<pre>
var servicesArray = new Array();
servicesArray = document.getElementsByName('Services');
services = servicesArray.toString();
var radius = document.getElementById('radius').value;
var searchUrl = '../PHP/db-XMLFunctions.php?lat=' + center.lat() +
'&lng=' + center.lng() + '&radius=' + radius + '&services=' +
services;
</pre>
When I set up a Watch on either the "servicesArray" or "services"
variables both of them show as empty in Firebug.
On the other hand, if I code the button to submit the form to the
following PHP code:
<pre>
$services = implode(",", $servicesArray);
echo "Services selected are: $services<br /><br />";
</pre>
The check boxes that I have checked off show up on the PHP page as
expected. What am I missing here?
Why does the PHP work and the JavaScript not?
Any help would be greatly appreciated.
--
You received this message because you are subscribed to the Google Groups
"Firebug" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/firebug?hl=en.