Expand my Community achievements bar.

SOLVED

Blocking form fields before sending by e-mail

Avatar

Former Community Member


I’ve created a form with some fields and button to send it through e-mail. This button should send the form with the filled in information in PDF format and, before being sent, some of the form fields should be made read only so no one else can change the fields contents.

To reach this end, I used the following script:

  1. F.Page_1.Button1::full - (JavaScript, client)
  2. F.Page_1.FIELD_ONE.access = "readOnly";

..

  1. F.Page_1.FIELD_TWO.access = "readOnly";
  2. app.execMenuItem("Save");

However, when the file is sent the fields are not locked (read only), they can still be edited.

Thank you for any hints!

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

That is because you are using a button of type Submit. Thise buttons cannot be programmed. I suggest adding a second button (that is a regular button) and then the click event will be active. Add you code to that button and at the end of your code you can programmatically click the submit button like this your_button_name.execEvent("click") . After that you can make your submit button invisible so that the user only sees one button to click.

Hoep that helps

Paul

View solution in original post

3 Replies

Avatar

Former Community Member

You have your code on the Full event .....that will never fire for a button. Move your code to the click event and try it again.

Paul

Avatar

Former Community Member

Hi Paul,

Thank you for replying!

However, when you use the button to submit the form, the click event option is disabled (greyed out).

Are there any other alternatives?

Thank you!

Avatar

Correct answer by
Former Community Member

That is because you are using a button of type Submit. Thise buttons cannot be programmed. I suggest adding a second button (that is a regular button) and then the click event will be active. Add you code to that button and at the end of your code you can programmatically click the submit button like this your_button_name.execEvent("click") . After that you can make your submit button invisible so that the user only sees one button to click.

Hoep that helps

Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----