/    Sign up×
Community /Pin to ProfileBookmark

How can I disable a form after a certain period of time?

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

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliJun 09.2003 — 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..
Copy linkTweet thisAlerts:
@scriptkidJun 09.2003 — 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
Copy linkTweet thisAlerts:
@smithauthorJun 10.2003 — Thank you guys.
×

Success!

Help @smith spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...