Skip to main content
Participant
Sep 2, 2015 1:49 PM UTC
Question

Populate Text Entry Boxes from XML then add them together in CP8

I have a project for a client where they would like to have an HTML 5 responsive quotation calculator that will work on all platforms.

The sales team access the quotation tool from a central web address and the pricing used for the products needs to be stored in an external XML file so the client can keep that up to date directly, which is then pulled in to the CP8 quotation tool.

I'm nearly there but i've hit a sticking point that I just can't work out.

I followed this tutorial Common JavaScript Interface in Adobe Captivate 8 - YouTube and can call in my data from the XML file. If I put the variable in a Text Caption it works great.

Based on the items selected I need to add the variables together to produce a total for the quote. To do this I used this tutorial as an example Creating a Simple Calculator in Adobe Captivate 8 - YouTube which does what I need but it uses Text Entry Boxes so the user can enter their own values.

What I need help with is bridging that gap. Ideally I need to call in my XML variables directly in to Text Entry Boxes rather than Text Captions but I can not find a way of doing this that works. I have seen an SWF file for a previous version of Captivate but that will not work for me as it needs to be HTML5/iPad friendly.

Does anyone have any clues, help, suggestions please as to how you call in XML variables directly to TEB's - thanks!

This topic is closed to new replies. Start a new post to keep the conversation going.

4 replies

Lilybiri
Legend
Sep 2, 2015 2:03 PM UTC

Why does it have to be in a TEB? That interactive object, which has an associated variable, is meant to allow users to enter a value. If I understand your question correctly, you don't want to do that. Maybe you ignore that several learning interactions do have associated variables, even though they are non interactive? As long as you can store the data in a variable that is fine. One of those interactions is the Scrolling Text interaction. For calculation I would use advanced actions, but of course it works even easier with JS.

An advantage of that interaction is that you can change the value of the variable and it would show up, which is not the case when you change the value of a variable associated with a TEB.

This is not solving your problem, just a small tip.

Translate
1979KMKAuthor
Participant
Sep 2, 2015 2:27 PM UTC

Thank you for your quick reply Lilybiri, appreciated. Your right, it doesn't need to be a TEB at all, I just need some way of adding up the variables imported from the XML file.

However, there are 40 variables so using advanced actions I don't think will work as when they use the quote tool they may only select 10 variables rather than all 40 and want to generate a quote based on that.

My only reason for thinking about TEB is that I know I can add those together easily. I will have a look to see if I can find a JS solution.

Thanks again.

Translate
Lilybiri
Legend
Sep 2, 2015 3:39 PM UTC

I still don't understand why you need TEB's at all?

Translate