Results 1 to 2 of 2

Thread: adjusting disable script

  1. #1
    Join Date
    Sep 2007
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb adjusting disable script

    this script play on the disable option of form elements...

    but in order to set it up i need to write all the "name" of all form elements inside the
    <input type="checkbox" name="control1" onclick="enableDisable(this,'day','month','year','hour','min')" />

    'day','month','year','hour','min' - those are just examples...i got much more of elemets...

    how can i make this script recognize all the elements inside <form name="example1"> by itself...with no need from my side to specify all elements like this (this,'day','month','year','hour','min')"

    hope someone here can help me with this
    Last edited by hantz; 11-19-2007 at 01:37 PM.

  2. #2
    Join Date
    Sep 2007
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking never mind

    for (var i=0;i<frm.elements.length;i++){
    obj = frm.elements[i];
    if (obj==oChk) continue;
    if (typeof obj=="object"){
    if (document.layers) {
    if (disable){
    obj.onfocus=new Function("this.blur()");
    if (obj.type=="text") obj.onchange=new Function("this.value=this.defaultValue");
    }
    else {
    obj.onfocus=new Function("return");
    if (obj.type=="text") obj.onchange=new Function("return");
    }
    }
    else obj.disabled=disable;
    }

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •