Link to home
Start Free TrialLog in
Avatar of willsherwood
willsherwood

asked on

JS: cancel a pending page REFRESH if viewer types in TEXTAREA field

We have the following header refresh to auto-refresh after 10 minutes,

<meta http-equiv="refresh" content="600" />

but we want to cancel that refresh if focus (click into) is set to the main textarea on the page (thus a refresh would not seemingly asynchronously foil the viewer's in-progress typing into the textarea prior to SUBMITting).

1.  Is there a JS way to undo the header tag?
2. (if not) is there an alternate way to set a countdown in JS that refreshes on timeout, and thus clicking into the textarea could cancel that countdown somehow
ASKER CERTIFIED SOLUTION
Avatar of R-Byter
R-Byter
Flag of Serbia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of willsherwood
willsherwood

ASKER

i think this is what i need.  super!
one clarification:    in order to stop the refreshing once focus was there,  i think in the textarea  i would want   a call to cto() .   does that make sense to use  cto() instead of  RefreshPage() ?

thanks
Yup, my mistake on that line, you noticed it well. Thanks for the points.

Regards