Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Javascript to dynamically change url in submit button

Avatar

Level 1

Hi guys

Is there anyone who can share the code to dynamically change the url in the submit button?

Thanks

Sam

1 Reply

Avatar

Level 10

Change the button to Regular button instead of Submit and write the code in the click event of the button.

(OR)

Keep the button as Submit and remove the URL in the button properties. Place the code in preSubmit event to set the URL for submit.

The code to set the URL in any of the above approaches:

this.resolveNode("#event").submit.target = "PLACE URL HERE";

Thanks

Srini