stwallace
06-26-2003, 09:11 AM
Could I possibly enlist your help for JavaScript coding. I'm trying to use a JavaScript that performs an onclick function for a checkbox.
When a user clicks on a checkbox, I would like for a textbox to display that will allow the user to input comments. I have a JavasScript that will do it but it will only allow me to add one script to the page. I need at least 6 of these checkboxes to one page.
Here is the example that works
<script>
function addControl() {
document.getElementById("myDiv").style.display="block";
}
</script>
<strong>Comment on this section (If "No Comment", do nothing): <input type="checkbox" name="C_Comment" class="text" onclick="addControl()" ></strong>
<div style="display:none;" id="myDiv">
<TEXTAREA wrap="virtual" class="Text" NAME="C_Evaluation" ROWS=4 COLS=68></textarea>
This example doesn't work
<script>
function addControl() {
document.getElementById("myDiv").style.display="block";
}
</script>
<script>
function addControl() {
document.getElementById("myPlan").style.display="block";
}
</script>
<strong>Comment on this section (If "No Comment", do nothing): <input type="checkbox" name="C_Comment" class="text" onclick="addControl()" ></strong>
<div style="display:none;" id="myDiv">
<TEXTAREA wrap="virtual" class="Text" NAME="C_Evaluation" ROWS=4 COLS=68></textarea>
<strong>Comment on this section (If "No Comment", do nothing): <input type="checkbox" name="P_Comment" class="text" onclick="addControl()" ></strong>
<div style="display:none;" id="myPlan">
<TEXTAREA wrap="virtual" class="Text" NAME="P_Evaluation" ROWS=4 COLS=68></textarea>[B]
Any help would be greatly appreaciated.
When a user clicks on a checkbox, I would like for a textbox to display that will allow the user to input comments. I have a JavasScript that will do it but it will only allow me to add one script to the page. I need at least 6 of these checkboxes to one page.
Here is the example that works
<script>
function addControl() {
document.getElementById("myDiv").style.display="block";
}
</script>
<strong>Comment on this section (If "No Comment", do nothing): <input type="checkbox" name="C_Comment" class="text" onclick="addControl()" ></strong>
<div style="display:none;" id="myDiv">
<TEXTAREA wrap="virtual" class="Text" NAME="C_Evaluation" ROWS=4 COLS=68></textarea>
This example doesn't work
<script>
function addControl() {
document.getElementById("myDiv").style.display="block";
}
</script>
<script>
function addControl() {
document.getElementById("myPlan").style.display="block";
}
</script>
<strong>Comment on this section (If "No Comment", do nothing): <input type="checkbox" name="C_Comment" class="text" onclick="addControl()" ></strong>
<div style="display:none;" id="myDiv">
<TEXTAREA wrap="virtual" class="Text" NAME="C_Evaluation" ROWS=4 COLS=68></textarea>
<strong>Comment on this section (If "No Comment", do nothing): <input type="checkbox" name="P_Comment" class="text" onclick="addControl()" ></strong>
<div style="display:none;" id="myPlan">
<TEXTAREA wrap="virtual" class="Text" NAME="P_Evaluation" ROWS=4 COLS=68></textarea>[B]
Any help would be greatly appreaciated.