Forum: JavaScript / DHTML / AJAX Dec 18th, 2008 |
| Replies: 3 Views: 2,349 Here, this should fix it:
EDIT: I don't know why you used an array by the way, and note the change I did with your switch case to see how it works with your buttons.
<!DOCTYPE HTML PUBLIC... |
Forum: JavaScript / DHTML / AJAX Dec 13th, 2008 |
| Replies: 19 Views: 4,960 What you could do is give each checkbox an ID and go by that ID instead of the name, then you can get the name of that checkbox because you have it's ID:
<input type="checkbox" id="checkBox1"... |
Forum: JavaScript / DHTML / AJAX Dec 12th, 2008 |
| Replies: 19 Views: 4,960 That depends on what's in $new['studentId']. Is it a number? I'm guessing it is, and how many do you have, in my example there are 5 checkboxes in the form. If your studentId's follow each other up... |
Forum: JavaScript / DHTML / AJAX Dec 12th, 2008 |
| Replies: 19 Views: 4,960 Excuse me, my previous post was indeed nonsense. This on the other hand should work:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>... |
Forum: JavaScript / DHTML / AJAX Dec 9th, 2008 |
| Replies: 19 Views: 4,960 function checkCheckBoxes() {
var i;
var isOneChecked = false;
for(i=0;i<5;i++) {
if(checkBoxCountry[i].checked) {
isOneChecked = true;
}
}
return... |
Forum: JavaScript / DHTML / AJAX Dec 8th, 2008 |
| Replies: 1 Views: 1,577 When I try to access http://www.airedale911.org/gen_validatorv31.js it says "The system cannot find the file specified."
Maybe that is where your problem lies, otherwise I'll have to see that code... |
Forum: JavaScript / DHTML / AJAX Dec 8th, 2008 |
| Replies: 19 Views: 4,960 onclick="if(this.checked == 1) { alert('checked: '+<? echo $newArray['id'];?>); }"
Hopefully this is what you want : - ) |
Forum: JavaScript / DHTML / AJAX Dec 6th, 2008 |
| Replies: 19 Views: 4,960 I should stop writing my posts so late, anyway
Looking back at my previous post I don't even think you HAVE to give them a unique ID to be able to iterate trough them. ID is there to give each... |
Forum: JavaScript / DHTML / AJAX Dec 6th, 2008 |
| Replies: 19 Views: 4,960 What you need to do in PHP is give each checkbox an individual ID then,
as in:
echo "<input type='checkbox' id='checkbox".$i."' name='".$checkboxName."'> </input>";
Now you can iterate... |
Forum: JavaScript / DHTML / AJAX Dec 5th, 2008 |
| Replies: 19 Views: 4,960 You can iterate trough forum controls with Javascript
var i;
for(i=1;i<18;i++) {
document.formPermissions.elements[i].checked = 1;
} |
Forum: JavaScript / DHTML / AJAX Dec 5th, 2008 |
| Replies: 3 Views: 1,597 How about this:
<script type="text/javascript">
function checkit(formName, checkBox) {
var xx = document.formName.elements.checkBox;
xx.checked = 1;
}
</script>
<form name="myform"> |