Click to See Complete Forum and Search --> : How can I disable a form after a certain period of time?


smith
06-09-2003, 10:29 AM
Hello,

I need to disable a HTML form after a certain time - after user session is expired - with the means of JavaScript.

Could you please help me or give me a piece of good advice to accomplish this task?

Cheers,
Andy

Khalid Ali
06-09-2003, 10:33 AM
you can use setTimeout()
js function.
Creae a JavaScript function that will disable the form/fields and then call that functionusing setTimeout


setTimeout("DisableElements()",30000)

the above will call the DisableElements() function after 30 seconds..

scriptkid
06-09-2003, 01:51 PM
furthermore make a loop statement taht loops thru the form element disabling each element of the document.form object instead of manually placing each element in the function
should be something like the following

function disable_form()
{
for( i=0; i<document.forms.length; i++ )
{
document.forms[i].enabled = false;
}
}

something along those lines

smith
06-09-2003, 09:37 PM
Thank you guys.