Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Nice continuously loop for submit-button-value: wait. wait.. wait... wait....

    When submitting a form, disableForm() is started, which disables the submit and reset button, and will change the submit-value to "please wait".

    I want that "please wait" changes by time, so:
    "please wait."
    "please wait.."
    "please wait..."
    "please wait...."

    My javascript debugger says:
    Fault: tempobj is not defined.

    Do you see the problem?
    Thanks in advance!


    Code:
    var dots=1;
    
    function disableFormDotDotRun(tempobj) {
    	if(dots==3) { dots=1; } else { dots++; }
    	setTimeout('disableFormDotDot(tempobj,dots)',50);
    }
    
    function disableFormDotDot(tempobj,dots) {
    	
    	if(dots==1) { var temp2="."; }
    	if(dots==2) { var temp2=".."; }
    	if(dots==3) { var temp2="..."; }
    
    	tempobj.value='moment a.u.b.'+temp2;
    	disableFormDotDotRun(tempobj);
    }
    
    function disableForm(theform) {
    	if(d.all||d.getElementById){
    		for(i=0;i<theform.length;i++){
    			var tempobj=theform.elements[i];
    			if(tempobj.type.toLowerCase()=='submit'||tempobj.type.toLowerCase()=='reset') {
    				tempobj.disabled = true;
    				disableFormDotDotRun(tempobj);
    			}
    		}return true;
    	}
    }
    Last edited by ozcar; 12-14-2006 at 11:09 PM.

  • #2
    New to the CF scene
    Join Date
    Nov 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay, thanks to some friends..

    I had to define the var tempobj before the functions, and now it works.
    Thanks!


  •  

    Posting Permissions

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