Playground and DEMO space
This is a playground and demo space for ConfiForms and ConfiDoc addons developed and supported by Vertuna LLC
Most pages provide a storage format for the demo, so you can use the free add-on from Atlassian Confluence Source Editor (or through the bundled in ConfiForms storage editor) to import this configuration into your Confluence and see it in action
To import examples from the storage format on Confluence Cloud please see this page
Please note, all the examples here are provided without any obligation and may or may not be incomplete or may have bugs, and we provide NO SUPPORT for these examples and demos.
As dialog
As embedded
(to show that there is no difference in the approach)
Storage format for the demo
<ac:structured-macro ac:macro-id="1e44be9a-086e-4888-a51d-f76122fe42d9" ac:name="confiform-entry-register" ac:schema-version="1"> <ac:parameter ac:name="formName">myform1</ac:parameter> <ac:parameter ac:name="embedded">true</ac:parameter> <ac:rich-text-body> <p> <br/> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="8a1daca4-bcaf-414b-ad7f-491797212a82" ac:name="confiform" ac:schema-version="1"> <ac:parameter ac:name="formName">myform1</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="db13acea-4acb-4ede-8904-9300d7cbc084" ac:name="confiform-field-definition" ac:schema-version="1"> <ac:parameter ac:name="fieldName">myvalue</ac:parameter> <ac:parameter ac:name="fieldLabel">My value</ac:parameter> <ac:parameter ac:name="fieldDescription">Type some value into this field, then click on show and set value checkbox fields</ac:parameter> <ac:parameter ac:name="type">text</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:macro-id="a59ad43d-7d5d-4ec8-9f0e-b0293c6631e9" ac:name="confiform-field-definition" ac:schema-version="1"> <ac:parameter ac:name="fieldName">showValue</ac:parameter> <ac:parameter ac:name="fieldLabel">Show my value with JavaScript</ac:parameter> <ac:parameter ac:name="type">checkbox</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:macro-id="a04e1a08-84b1-4d8c-b124-f164de9a62a4" ac:name="confiform-field-definition" ac:schema-version="1"> <ac:parameter ac:name="fieldName">setValue</ac:parameter> <ac:parameter ac:name="fieldLabel">Set my value with JavaScript</ac:parameter> <ac:parameter ac:name="type">checkbox</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:macro-id="dcace86d-bf96-4d5c-b523-b1642b38c2be" ac:name="confiform-field-definition" ac:schema-version="1"> <ac:parameter ac:name="fieldName">valueToBeSet</ac:parameter> <ac:parameter ac:name="fieldLabel">Value to be set with JavaScript</ac:parameter> <ac:parameter ac:name="type">read_only</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:macro-id="494b894f-98c1-4481-ac2c-0887dbbd29e2" ac:name="confiform-field-definition-rules" ac:schema-version="1"> <ac:parameter ac:name="condition">showValue:true</ac:parameter> <ac:parameter ac:name="values">showValueFunc(formName, formId);</ac:parameter> <ac:parameter ac:name="action">Run custom JavaScript</ac:parameter> <ac:parameter ac:name="actionFieldName">showValue</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:macro-id="10d934ac-26ac-481f-9425-ac48abacd243" ac:name="confiform-field-definition-rules" ac:schema-version="1"> <ac:parameter ac:name="condition">setValue:true</ac:parameter> <ac:parameter ac:name="values">setValueFunc(formName, formId);</ac:parameter> <ac:parameter ac:name="action">Run custom JavaScript</ac:parameter> <ac:parameter ac:name="actionFieldName">setValue</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="aa63a37a-fb63-4cbc-959d-64ffd661e539" ac:name="html" ac:schema-version="1"> <ac:plain-text-body><![CDATA[<script> function showValueFunc(formName, formId) { // never execute it in edit mode if (isPageViewMode()) { alert(AJS.$(formName).find('#i_myvalue').val()); } } function setValueFunc(formName, formId) { if (isPageViewMode()) { AJS.$(formName).find('#i_valueToBeSet').val(AJS.$(formName).find('#i_myvalue').val()); } } function isPageViewMode() { return AJS.$('#wysiwygTextarea_ifr').length === 0; } </script>]]></ac:plain-text-body> </ac:structured-macro>