How to allow a user to add Javascript to a form

38 views
Skip to first unread message

Mark Giffin

unread,
Dec 17, 2019, 2:50:36 PM12/17/19
to Angular and AngularJS discussion
I'm using AngularJS 1.6. An author creates a form by creating an XML file with a certain structure, and then the XML is processed by scripts to create the AngularJS form. I want to add the capability for the author to add Javascript capabilities to the forms so they can do things like this:

- Calculate a sum of two fields
- Hide table rows when certain conditions elsewhere in the form are met
- Set a field to mandatory if a condition is met
- Change the available values in a dropdown when certain selections are made elsewhere in the form

Security considerations: The forms are behind a firewall, not on the open internet, and are done by known, trusted people. So security is not as vital as it might otherwise be.

Do you have suggestions on good ways to go about this? Is it ridiculous to even try to do this?

Thanks,
Mark

Sander Elias

unread,
Dec 31, 2019, 4:43:55 AM12/31/19
to Angular and AngularJS discussion
Hi Mark, 

Look into formly (it might had a different name for the AngularJs version)

Regards
Sander
Reply all
Reply to author
Forward
0 new messages