Hi guys,
I have a very simple requirement for which Ive spent the last 3 days trying to figure out.
Requirement:
Show "JAVASCRIPT DISABLED" on form when Javascript is disabled. Show "" otherwise.
What I've done:
Problem:
For some reason, this script executes even when Javascript is disabled which completely defeats the purpose of the assignment.. Where should I place this Javascript such that it executes ONLY when Javascript is actually enabled....
Please help! Thanks!
Views
Replies
Total Likes
Hi,
if you want to change the value of a static text use this script.
StaticText.value.text.value = "JS is turned on"
Make sure you restart your Acrobat or Reader when you turned JavaScript on or off, otherwise you don't see any change!
If you are trying to test for JavaScript without reloading the document it won't work. It has to be done when the document is loaded.
Check this thread for a sample of how to check for JavaScript when opening a document.
http://forums.adobe.com/message/2502422
Essentially you display the message that JavaScript is disabled by default - if JavaScript is turned on then you hide the message and display the form. This is because if JavaScript is disabled you won't be able to run any scripts.
Guys, thanks for the reply.
Jono - I've tried to follow the steps from your document 'Javascript and version test.pdf' but the following problem occurs. My Javscript code runs even when Javascript is disabled! I know this sounds insane, but please look at the snapshots.
Note: For the sake of showing you the problem, I've reversed the visible/hidden.
Initially the TextField is set to Hidden. Then, in the initialize event - I set it to Visible...
As you can see below, even when the bar says "Javascript is currently disabled", it sets the TextField to Visible.
I've been hacking at this for days now, is there something that I'm missing. This shouldnt be this difficult, right?
Thanks again for your help.
Views
Replies
Total Likes
Can you share the form via acrobat.com or something like that?
If JavaScript is turned off nothing should happen. The only other thing I can think of off-hand is some sort of corruption.
Views
Replies
Total Likes
Views
Likes
Replies