R
reneeccwest
Hello,
The below code will be automatically filled and disabled in the user
input box when the usrinput field and one of the fields (which are
test1, test2, test3, test4, test5, and test5) is same.
But also I'd like to see the result that when the value (test1, test2,
test3, test4, test5, and test5) which is same as the usrinput field
is changed to a value which is not same as the usrinput field, I'd
like to make it and everything below of the field as empty. So I can
fill a different value there. Can anybody help on this extra feature?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<!--- != --->
<script language="JavaScript">
function updatethisform1() {
if (document.test.usrinput.value == document.test.field1.value){
document.test.field2.value = document.test.usrinput.value;
document.test.field3.value = document.test.usrinput.value;
document.test.field4.value = document.test.usrinput.value;
document.test.field5.value = document.test.usrinput.value;
document.test.field6.value = document.test.usrinput.value;
document.test.field2.disabled = true;
document.test.field3.disabled = true;
document.test.field4.disabled = true;
document.test.field5.disabled = true;
document.test.field6.disabled = true;
}
else if (document.test.usrinput.value == document.test.field2.value){
document.test.field3.value = document.test.usrinput.value;
document.test.field4.value = document.test.usrinput.value;
document.test.field5.value = document.test.usrinput.value;
document.test.field6.value = document.test.usrinput.value;
document.test.field3.disabled = true;
document.test.field4.disabled = true;
document.test.field5.disabled = true;
document.test.field6.disabled = true;
}
else if (document.test.usrinput.value == document.test.field3.value){
document.test.field4.value = document.test.usrinput.value;
document.test.field5.value = document.test.usrinput.value;
document.test.field6.value = document.test.usrinput.value;
document.test.field4.disabled = true;
document.test.field5.disabled = true;
document.test.field6.disabled = true;
}
else if (document.test.usrinput.value == document.test.field4.value){
document.test.field5.value = document.test.usrinput.value;
document.test.field6.value = document.test.usrinput.value;
document.test.field5.disabled = true;
document.test.field6.disabled = true;
}
else if (document.test.usrinput.value == document.test.field5.value){
document.test.field6.value = document.test.usrinput.value;
document.test.field6.disabled = true;
}
}
</script>
<form name="test" action="test.cfm" method="post">
TEST:<input type="text" name="usrinput" value=""><br><br>
TEST 1:<input type="text" name="field1" value=""
onchange="updatethisform1()"><br>
TEST 2:<input type="text" name="field2" value=""
onchange="updatethisform1()"><br>
TEST 3:<input type="text" name="field3" value=""
onchange="updatethisform1()"><br>
TEST 4:<input type="text" name="field4" value=""
onchange="updatethisform1()"><br>
TEST 5:<input type="text" name="field5" value=""
onchange="updatethisform1()"><br>
TEST 6:<input type="text" name="field6" value=""
onchange="updatethisform1()"><br>
<input type="Submit" value="submit">
</form>
</body>
</html>
The below code will be automatically filled and disabled in the user
input box when the usrinput field and one of the fields (which are
test1, test2, test3, test4, test5, and test5) is same.
But also I'd like to see the result that when the value (test1, test2,
test3, test4, test5, and test5) which is same as the usrinput field
is changed to a value which is not same as the usrinput field, I'd
like to make it and everything below of the field as empty. So I can
fill a different value there. Can anybody help on this extra feature?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<!--- != --->
<script language="JavaScript">
function updatethisform1() {
if (document.test.usrinput.value == document.test.field1.value){
document.test.field2.value = document.test.usrinput.value;
document.test.field3.value = document.test.usrinput.value;
document.test.field4.value = document.test.usrinput.value;
document.test.field5.value = document.test.usrinput.value;
document.test.field6.value = document.test.usrinput.value;
document.test.field2.disabled = true;
document.test.field3.disabled = true;
document.test.field4.disabled = true;
document.test.field5.disabled = true;
document.test.field6.disabled = true;
}
else if (document.test.usrinput.value == document.test.field2.value){
document.test.field3.value = document.test.usrinput.value;
document.test.field4.value = document.test.usrinput.value;
document.test.field5.value = document.test.usrinput.value;
document.test.field6.value = document.test.usrinput.value;
document.test.field3.disabled = true;
document.test.field4.disabled = true;
document.test.field5.disabled = true;
document.test.field6.disabled = true;
}
else if (document.test.usrinput.value == document.test.field3.value){
document.test.field4.value = document.test.usrinput.value;
document.test.field5.value = document.test.usrinput.value;
document.test.field6.value = document.test.usrinput.value;
document.test.field4.disabled = true;
document.test.field5.disabled = true;
document.test.field6.disabled = true;
}
else if (document.test.usrinput.value == document.test.field4.value){
document.test.field5.value = document.test.usrinput.value;
document.test.field6.value = document.test.usrinput.value;
document.test.field5.disabled = true;
document.test.field6.disabled = true;
}
else if (document.test.usrinput.value == document.test.field5.value){
document.test.field6.value = document.test.usrinput.value;
document.test.field6.disabled = true;
}
}
</script>
<form name="test" action="test.cfm" method="post">
TEST:<input type="text" name="usrinput" value=""><br><br>
TEST 1:<input type="text" name="field1" value=""
onchange="updatethisform1()"><br>
TEST 2:<input type="text" name="field2" value=""
onchange="updatethisform1()"><br>
TEST 3:<input type="text" name="field3" value=""
onchange="updatethisform1()"><br>
TEST 4:<input type="text" name="field4" value=""
onchange="updatethisform1()"><br>
TEST 5:<input type="text" name="field5" value=""
onchange="updatethisform1()"><br>
TEST 6:<input type="text" name="field6" value=""
onchange="updatethisform1()"><br>
<input type="Submit" value="submit">
</form>
</body>
</html>