Skip to main content
Participating Frequently
January 26, 2021
Question

Text entry Box as search box

  • January 26, 2021
  • 2 replies
  • 1006 views

How can I make text entry box search for multiple specific slide names for example on a windows desktop where you can search for file name or software name and takes you to the page. 

 

help. it's urgent

 
 

This topic has been closed for replies.

2 replies

TLCMediaDesign
Inspiring
February 3, 2021

Here is a way to make it work with a prompt, just execute this JS with a button:

 

var myTitle = prompt("Please enter a slide title", "");

if ( myTitle !== null || myTitle !== "")
{
var res = cp.model.data.project_main.slides.split( ',' );
res.forEach( checkLabel);
}

function checkLabel(item, idx)
{
if ( cp.model.data[ item ].lb === myTitle )
{
cpCmndGotoSlide = idx;
}
}

RodWard
Community Expert
Community Expert
January 27, 2021

There is no advanced action that you can easily set up to make text entered into a TEB automatically jump the user to slides that contain the search term.  It would require having a very large and complex Conditional Advanced Action.  JavaScript would be a better option but then you would need the services of a JavaScript programmer.

 

But... if you are using the standard Captivate TOC, then you have the option in the TOC settings to turn on the Search box in the TOC.

This at least will highlight any items in the TOC that might match your keyword.

Participating Frequently
January 28, 2021

Thank you for replying.  I tried it didn't accomplish what I'm trying to achieve. 

What I'm trying to do is with Text Entry Box, how can I use it as a search box where user can type in specific word like: door, windows, table etc. maybe with variable if user type in Door (not case sensitive) and press enter, it will take the user to slide title door. and the same Text Entry Box can be use to navigate to other slide  and then return back to main menu, enter another name and will take user to the the slide name.  Only want the user to be able to navigate to selected slide name  using Text Entry Box.

 

i hope this make sense

TLCMediaDesign
Inspiring
February 2, 2021

Great question. Also not for the faint of heart.

1. You should have all your slides in place and named the way you want.

2. Start by creating a variable in Captivate. In my example, I will call it  slideNames

3. Go to the onEnter action for the first slide and select  Execute JavaScript

4. In the box that pops up we will assign the array values to the variable you created.
slideNames=["dog","cat","bird","horse","pig","chicken"];

5. In the example above, we have six entries in the array. These should exactly match the names of all your slides in chronological order. Pay careful attention to spelling and case.

 

Hopefully this helps.


You can build an array of slide labels like this:

 

var labels =[];

var res = cp.model.data.project_main.slides.split( ',' );

res.forEach(myFunction);

function myFunction(item, idx)
{
labels[idx] = cp.model.data[ item ].lb;
}
console.log(labels)