Help with Querystring

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.

 

 

Discussions have been disabled for this post