You are viewing limited content. For full access, please sign in.

Question

Question

Collections with Custom HTML controls

asked on December 10, 2015 Show version history

Is there a way to have the variables in a collection refer to the field values in the current repeating section when used in a Custom HTML control?

I'm trying to give users the ability to enter additional form sections as needed, with the content from those sections being used to display in a Custom HTML control, depending on the value of the fields. I have this working to a degree, but am now stuck.

Here's an example of what I'm looking for:

<table><tbody>
<tr>
<td>{/dataset/Collection[i]/MyField}</td>
</tr>
</tbody></table>

In the example, the "i" in the brackets should refer to the index of the current set of fields in the collection.

It seems like there should be a way to accomplish this, but I haven't found it yet.

Thanks for any help you can provide!

0 0

Replies

replied on December 11, 2015

Hi there,

Can you provide a screenshot of your collection, what you expect to see?

0 0
replied on December 11, 2015

Here's an example of the collection, what the participant sees, and what I expect the participant to see when the he/she wants to insert a new section into the form/document:

The participant fills in the Level, Type of Content, and Content fields and javascript updates the Custom HTML control that's above the Level field with the new index, format, and content.

You can see that 2 new sections were added in this collection and that the Custom HTML control has the indices (C, D) and the text that was entered in the textbox.

When the participant is done filling in all the fields necessary on the form, he/she submits the form. Then the next form in the process combines the fields on the form submitted with the fields on another form to give the participant a full look at the document being created. This is where the problem arises...

The participant opens the combination form for review. It shows all the information that was filled in on the previous forms, which is now contained in Custom HTML fields, not textboxes. What they see for the collection is:

I want the participant to see the HTML fields like this:

0 0
replied on December 11, 2015

Hi there,

Since you want to carry over value, it's better use a field in a collection, instead of CustomHTML field. You can use Javascript to fill in the single line field with the Content value. Then in the next user task, it'll be readonly field with the correct value displayed.

0 0
replied on December 12, 2015

I don't think using a field in the collection to do this will work because it has to have identical formatting to all the other HTML on the document. But I haven't tried to use CSS to format the display of textboxes (they'll be multiline). I'm just not sure how flexible it will be with font size, line spacing, etc.

The indentations will also change depending on the index level, which right now is being handled in an HTML table.

I'll have to do try this and see if it will give me the results I need.

 

0 0
replied on December 14, 2015

Hi Sheila,

You can use a hidden singleline input to store the data. And use javascript and CSS to create a paragraph to make a copy of the singleline data and format the data in the singleline as you need.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.