eLBX Online 2021 | June 22 - 24


Join us for a FREE, 3-day virtual conference featuring industry experts and eLearning thought leaders. Learn about critical topics such as eLearning accessibility, learning experience design, course authoring, virtual reality, and gamification. Register today!
CHECK IT OUT

Help with Querystring

hillk1
hillk1 Community Member Posts: 8
Ok I see several problems with your structure.  Here is how you can fix them.

I have a function that I'm calling on clicking the done button

My actual function is as follows: function goNext() { window.top.location.href='/onlinelearning/trnmnu.asp' + location.search + '&moveForward=1' }

If I view the properties of the page that the button is now opening, the URL is: /onlinelearning/trnmnu.asp&moveForward=1 It should be something like: /onlinelearning/trnmnu.asp?roleid=909&caseid=1723&presid=8907&moveForward=1

The querystring (?roleid=909&caseid=1723&presid=8907) is only available on the first page of the title because on Next, Lectora loads a separate page. I need to be able to capture the "?roleid=909&caseid=1723&presid=8907" in a variable and then pass that variable back into the function when the user reaches the last page and they click the Done button.

I'm thinking an action: On: Show Action: Modify Variable Target: QueryLocation Value: ? Modifcation: Set Variable Contents

Done button function: Action: Go To Target: Web Address Web Address: javascript:goNext(QueryLocation)

Header Script Function: function goNext() { window.top.location.href='/onlinelearning/trnmnu.asp' + QueryLocation + '&moveForward=1' } } Would something like this work? Where do I establish "QueryLocation" as a variable?

You need to set QueryLocation as a variable in Lectora, do this using the Variable manager.

To reference this variable in javascript, you need to talk to it this way: Varquerylocation.getValue(), or something like Varquerylocation.setValue();

So your header function should look like this: Header Script Function: function goNext() { window.top.location.href='/onlinelearning/trnmnu.asp' + Varquerylocation.getValue() + '&moveForward=1' } }

The second part is the greater problem. Your code of:

Done button function: Action: Go To Target: Web Address Web Address: javascript:goNext(QueryLocation)

Will not work with the current formatting.  Change the javascript to: Javascript:goNext(VAR(QueryLocation));

This should get you started on the right path.

 

 
Sign In or Register to comment.

So You Wanna Be An eLearning ROCKSTAR?

We're all fans of eLearning here! Want to become an eLearning ROCKSTAR? Just click on one of the buttons below to start your rocking journey!