• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How can I password-protect a text-field button?

Community Beginner ,
Sep 10, 2016 Sep 10, 2016

Copy link to clipboard

Copied

Using Adobe Acrobat DC.

A final button on page one is titled: 'Next Page: ADMIN only'.

How can I password protect the button to where if a student clicks on the button, a password box would pop up (so that access to the next page is restricted to admin personnel only)?

Thanks in advance!

TOPICS
Acrobat SDK and JavaScript , Windows

Views

4.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Sep 12, 2016 Sep 12, 2016

Thank you ALL for you insightful wisdom and input to this.

And thank you, gkaiseril, for throwing in a sample script. Indeed, I will commence my Great Experiment and see what I see.

FYI to all: this is not a sensitive or confidential security matter in that the admin page simply duplicates the students Content-area entries from page one (so that our admin person can review the content for final save/printout/distribution)....so even if a student somehow got around the password protection of the hi

...

Votes

Translate

Translate
Community Expert ,
Jul 02, 2019 Jul 02, 2019

Copy link to clipboard

Copied

The code above is missing the most crucial part: The command to reject the newly entered value if the wrong password is entered.

Basically, you can do it with this code (as the field's custom validation script):

event.rc = (app.response("Enter the password:","","")=="1234");

(The password in the line above is "1234")

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 02, 2019 Jul 02, 2019

Copy link to clipboard

Copied

Man, you are a gentleman and a scholar! Thank you so much! That works beautifully!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 02, 2019 Jul 02, 2019

Copy link to clipboard

Copied

try67, I tried to mark your answer as correct, but since we're in someone else's thread, it won't let me! Should I start a new thread so you can get credit for your work? I will if you say so!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 02, 2019 Jul 02, 2019

Copy link to clipboard

Copied

LATEST

No, that's fine... It's not worth the trouble. Just glad to hear it worked!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 30, 2019 Jun 30, 2019

Copy link to clipboard

Copied

Additionally, I have the text box formatted as "Percentage." This means you must enter the percentage with a decimal point/period in front; i.e., 89.5 percent must be entered as .895. Is there a script to convert it so that the instructor can enter it AS 89.5?

I tried to revise a line from another script, putting it in the Calculate tab—Custom Calculation Script field:

event.value = Math.round(n23 / t * 1000) / 10; 

I specified

var n23 = Score // (the name of the text box)

var t = 0

I realize these are probably incorrect values (they didn't work!), but I don't know how to specify the text box in question ("Score") or how to reference the entered value to change it to a "regular" value.

Any help will be GREATLY appreciated!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 29, 2019 Jun 29, 2019

Copy link to clipboard

Copied

You can't stop it from making the "ding" sound. If you don't want it simply remove this line entirely.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 29, 2019 Jun 29, 2019

Copy link to clipboard

Copied

What would stop the student just scrolling to the next page and ignoring your button? And what would happen if the student turned off JavaScript?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines