I am trying to save information from a text box if the checkbox is selected. The checkboxes are dynamically created with php from mysql tables, so I don't know the index of the array that I would like to delete. My plan is use javascript to delete the null values from the textboxes so the length of that element will correspond with the length of the checkbox element, but I can't figure out how to use the splice method correctly...
I have this function called with onsubmit...
Expand|Select|Wrap|Line Numbers
- function DoTheCheck(form){
- var i = 0;
- var j = form.elements['programs[]'].length;
- for(i=0;i<j;i++){
- if (form.elements['programs[i]'].value==''){
- form.elements['programs[i]'].splice(form.elements['programs[i]'].value(i,1);
- }
- }
- }