Jump to content

brodywx

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Everything posted by brodywx

  1. how do I get the size of a sub array in a multidimensional array? if if I have an array like so: {'1', '2', '3'} , {'1', '2'} , {'1', '2', '3', '4'} how do I get the size of the second sub array, which should be 2?
  2. Ok I screwed that plan and decided to use the id value for the checkbox: document.getElementById('chkID').checked="checked"; This seems to be working alright.
  3. Yes I tried that. I think it has something to do with the name group[item]. If the name was not an array type the line works just fine, but javascript doesn't like it when the checkbox name is an array, so has anyone ever done it before? I know it must be possible.
  4. I know this doesn't relate to php right now, but eventually it will use php code. Still if someone could help me it would be much appreaciated. I want to know how to check/uncheck checkboxes using javascript. My checkboxes are part of a group (name="group[item]"). The items are random and not sequentially ordered in any way. I assumed this code would work, but it's giving me a page error: document.myForm.group[item].checked=1; Anyone?
  5. Thank effigy. That was exactly what I was looking for.
  6. Here's a snippet from my form. It loops a bunch of times creating checkboxes like so: <input type=checkbox name=filterItem[".$in_row[ProfileGroup]."] id=\"fi".$in_row[ProfileGroup]."\" ".$chk." onclick=\"javascript:SetChecked(this,'filterItem[".$in_row[ProfileID]."]')\"> <font size=-1><label for=\"fi".$in_row[ProfileGroup]."\"><b>".$in_row[ProfileGroup]."</b></label></font> I'm testing this statement to see if I can't determine which checkboxes are check: echo $_POST['filterItem['.$itemsArray[0].']']; RIght now it doesn't output anything, even though $itemsArray has values in it.
  7. I have an array of checkboxes. When the user submits the form I'm trying to find out which checkboxes are selected. I'm grabbing them through the $_POST variable, but it's not working. If my checkbox array has the name chkArr[someValue], then why can't I use this statement to get it's value: $_POST['chkArr[someValue]'] ???
  8. Alright cool, I'll go change my code and see if things start working.
  9. would array push work like this: array_push($arr, "zero", "0");
  10. I want to make a multidimensional array. Using the last example: $arr[0][0] // would be "zero" $arr[1][1] // would be "1"
  11. Can someone tell me if this how to add and array to an array: $arr = array(); $arr[] = array("zero", "0"); $arr[] = array("one", "1"); $arr[] = array("two", "2");
  12. Here's some example code of checkboxes I'm generating by an SQL query: <input type=checkbox name=filterItem[Regular] id="fi6554" onclick="javascript:SetChecked(this,'filterItem[6554]')"> <font size=-1><label for="fi6554"><b>Regular</b></label></font> <div class="indented"> <input type=checkbox name=filterItem[6554] id="fi6554" > <font size=-1><label for="fi6554">Future Member</label></font><br /> <input type=checkbox name=filterItem[6563] id="fi6563" > <font size=-1><label for="fi6563">Member</label></font><br /> </div> How do I determine which checkboxes the user has checked when they submit the form? I need to be able to create a dynamic sql script based on items they've selected.
  13. right now all I know how to get it the name of the checkbox, but this is useless to me cause I'm using the name in a seperate javascript function. So how in the world can I get the checkbox id?
  14. Hello, If I'm looping through a checkbox array, called itemFilter[], is it possible to get the id value from each checkbox. I'm very new to php so I'm struggling to figure this out. Here's my looping code I have right now: $itemFilter=$_POST['filterItem']; foreach ($itemFilter as $value) { echo "$value is checked"; }
  15. Hi all, I have a bunch of dynamically generated checkboxes with name=filterItem[]. For each checkbox I'm creating a label. When the form is submitted I loop through all the checkboxes using this code: $itemFilter=$_POST['filterItem']; foreach ($itemFilter as $value) { echo "$value is checked"; } Is there any way I can get the text value from the <label> I created for the text box?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.