Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

Disable submit button after submission

Avatar

Level 2

We have a form that we have distributed to multiple users. The form is set so that submissions go to a pre-defined server location. The problem is that some of the users submit the form multiple times (not sure why). Perhaps they don't notice the message that says "Form submitted". In any case, we would like to disable the submit button after the form is submitted (even it is only for that "session"). I know that once the form is closed and reopened the button will work again and that is ok. If anyone has some suggestions I would appreciate it. Thanks.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

hi,

modify the above script to:

this.access = "readOnly";

your submit button will be set to read only.

Regards--

Chalukya

View solution in original post

4 Replies

Avatar

Former Community Member

Hi,

You can put this script in post-submit event of your submit button.

this.presence = "invisible"

Hope this will fulfil your requirement.

Regards-

Chalukya.

Avatar

Level 2

Thank you for the response. That is a great tip and I can use it if this other option is not possible. What would be ideal is to make the button "readonly". greyed out or otherwise disabled. I looked through the propoerty list and I couldn't see a way to make that happen. Is there a property to force "readonly"?

Avatar

Correct answer by
Former Community Member

hi,

modify the above script to:

this.access = "readOnly";

your submit button will be set to read only.

Regards--

Chalukya

Avatar

Level 2

That does it for me... Thanks.

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] ----