h8ids
04-05-2006, 10:18 PM
I have two text boxes.
The goal is to control the content of the second based upon the content of the first.
Example: If the content of box one is "No", then JavaScript will automatically remove data from box two.
Here is what I have worked out so far. I know it is incomplete, still learning the basic JS coding.
<script>
function fieldCheck(myfield){
if (myfield.value=="No" || elementid=="NO")
document.getElementById(LabTimes)="";
}
</script>
<!--Will there be a lab-->
<br><b>4.</b> Lab: <input type="Text" size="3" maxlength="3" name="LaboratoryYesNo" onBlur="fieldCheck(this)" value="">
"Yes" or "No"<br>
<!--Lab times-->
<b>Lab times:</b> <input type="Text" size="40" maxlength="40" name="LabTimes" value="">
The goal is to control the content of the second based upon the content of the first.
Example: If the content of box one is "No", then JavaScript will automatically remove data from box two.
Here is what I have worked out so far. I know it is incomplete, still learning the basic JS coding.
<script>
function fieldCheck(myfield){
if (myfield.value=="No" || elementid=="NO")
document.getElementById(LabTimes)="";
}
</script>
<!--Will there be a lab-->
<br><b>4.</b> Lab: <input type="Text" size="3" maxlength="3" name="LaboratoryYesNo" onBlur="fieldCheck(this)" value="">
"Yes" or "No"<br>
<!--Lab times-->
<b>Lab times:</b> <input type="Text" size="40" maxlength="40" name="LabTimes" value="">