Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Free text search and disable field

Status
Not open for further replies.

ashz

Programmer
Dec 9, 2002
43
0
0
ES
Is it possible to write script that will disable all input text fields and checkboxes buttons if a one specific text field as input? (E.g. I have built a query interface and add a possibility to do a free text search in the database and therefore I want to cancel all the fields, checkboxes, etc so anther input will not be query).

 
<script>
function disableEm(){
if (document.myForm.freeText.checked){
for (x=0; x<document.myForm.elements.length; x++){
if (document.myForm.elements[x].type != &quot;submit&quot; && document.myForm.elements[x].name != &quot;freeText&quot;){
document.myForm.elements[x].disabled = true
}
}
}
}
</script> Get the Best Answers! faq333-2924
&quot;A witty saying proves nothing.&quot; - Voltaire
mikewolf@tst-us.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top