Jako , ze nie znalazlem takiego tematu na forum pytam w swoim watku.
Przechodzac do sedna :
Robie znajomemu generator , niestety do tego potrzebuje 2 "onClick". Znalazlem 2 skrypty , ktore wykorzystuja 2 rozne , jednak nie wiem jak je polaczyc.
Oto Funkcja:
CODE
<script LANGUAGE="JavaScript">
function countChoices(obj) {
max = 1;
box1 = obj.form.box1.checked;
box2 = obj.form.box2.checked;
count = (box1 ? 1 : 0) + (box2 ? 1 : 0)
if (count > max) {
alert("Oops! You can only choose up to " + max + " choices! \nUncheck an option if you want to pick another.");
obj.checked = false;
}
}
</script>
function countChoices(obj) {
max = 1;
box1 = obj.form.box1.checked;
box2 = obj.form.box2.checked;
count = (box1 ? 1 : 0) + (box2 ? 1 : 0)
if (count > max) {
alert("Oops! You can only choose up to " + max + " choices! \nUncheck an option if you want to pick another.");
obj.checked = false;
}
}
</script>
Tutaj "OnClick" Do niej:
CODE
onClick="countChoices(this)"
A tutaj drugi "onClick":
CODE
<input type="checkbox" name="box1" onClick="document.getElementById('id').style.display = this.checked ? 'block' : 'none'; this.form.elements['nazwa2'].disabled = this.form.elements['nazwa3'].disabled = !this.checked>Sekcja1
Probowalem to zrobic na takiej zasadzie , jednak nie dzialalo :
CODE
<input type="checkbox" name="box2" onClick="document.getElementById('id).style.display = this.checked ? 'block' : 'none'; this.form.elements['nazwa2'].disabled = this.form.elements['nazwa3'].disabled = !this.checked.countChoices(this)">Section 1
Prosilbym o szybka pomoc i z gory dziekuje.