Jump to content

Hide Blank Field In Acknowledgement Email


Recommended Posts

Hello artdocent,

 

If I understand correctly, what your goal is, you can try following steps:

1) Add a Rule: if a user does not select the check box, hide fields of alternate date.

2) Create Hidden virtual fields, where labels of the alternate date fields will be placed;

3) Insert in Acknowledgment email the code like:

[@cbParamVirtual1] <cb:field name="secondaddress"/>
[@cbParamVirtual2] <cb:field name="thirdaddress"/>

If a user does not select to fill alternate date, the virtual fields and values of entered fields will be empty, so nothing will be displayed in the email.

4) Add a Header&Footer element and then enter the code like:

<SCRIPT LANGUAGE="JavaScript">
function setFields()
{
   var isSet = document.getElementById("InsertRecordthesameaddress").checked;
   if (isSet)
      {
         document.getElementById("cbParamVirtual1").value = "second address:";
         document.getElementById("cbParamVirtual2").value = "third address:";
      }
}
document.getElementById("caspioform").onsubmit = setFields;
</SCRIPT>

Please enter your field instead of  thesameaddress in InsertRecordthesameaddress.

And enter your labels for Virtual fields instead of "second address:" and "third address:"

I worked with two fields, but you can add as many as you want.

 

Now, if a user selects the check box, labels and values will be added to the email.

 

I hope, it helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...