Print TEB's using Javascript - Issue with Print Window URL
Hi everyone - ok, here's the mission......
I have a module that will be hosted on a LMS which has a number of Notes pages spread throughout the module. On each Notes page there are 2 or 3 questions with Text Entry Boxes available for users to provide responses (Each TEB has a variable assigned) .
I have a button at the end of the module that executes javascript to get the responses provided in the TEB's and then create a document with those responses that can be printed. In essence, I have simply modified a version of eLearning Bros js - HERE.
All works well in IE11 and Chrome until a certain point. It appears as though the javascript is adding every question and answer to the URL - (example below) at which point I receive a HTTP 404 error.
Appears as though receiving error due to maximum being reached of 2083 characters in total across the 23 TEB's. Have seen on the web that there is a limitation with length of URLs for different browsers.
Is there anything I can do / add to the javascript or amend the javascript to shorten, or remove the questions and answers from the URL ?
I have added the javascript I am using to the end of this thread
All help GREATFULLY received !
JAVASCRIPT
var header = "Notes~~"
var args =(
"What part of the cycle is your team good at ?~~" +
window.cpAPIInterface.
getVariableValue('What_part_of_the_cycle_is_your_team_good_at_1')+
"~~What part of the cycle could your team improve ?~~" +
window.cpAPIInterface.
getVariableValue('What_part_of_the_cycle_could_your_team_improve_2')+
"~~Additional Notes~~" +
window.cpAPIInterface.
getVariableValue('Additional_Notes1_3')+
"~~What part of the cycle is your team good at ?~~" +
window.cpAPIInterface.
getVariableValue('What_part_of_the_cycle_is_your_team_good_at_4')+
"~~What part of the cycle could your team improve ?~~" +
window.cpAPIInterface.
getVariableValue('What_part_of_the_cycle_could_your_team_improve_5')+
"~~Additional Notes~~" +
window.cpAPIInterface.
getVariableValue('Additional_Notes2_6')+
"~~What part of the cycle is your team good at ?~~" +
window.cpAPIInterface.
getVariableValue('What_part_of_the_cycle_is_your_team_good_at_7')+
"~~What part of the cycle could your team improve 8~~" +
window.cpAPIInterface.
getVariableValue('What_part_of_the_cycle_could_your_team_improve_8')+
"~~Additional Notes~~" +
window.cpAPIInterface.
getVariableValue('Additional_Notes2_9')+
"~~What actions will you commit to ?~~" +
window.cpAPIInterface.
getVariableValue('What_actions_will_you_commit_to_10')+
"~~Additional Notes~~" +
window.cpAPIInterface.
getVariableValue('Additional_Notes_11')+
"~~What part of the cycle is your team good at ?~~" +
window.cpAPIInterface.
getVariableValue('What_part_of_the_cycle_is_your_team_good_at_12')+
"~~What wastes your time and resources ?~~" +
window.cpAPIInterface.
getVariableValue('What_wastes_your_time_and_resources_13')+
"~~How are you doing against today's targets and why ?~~" +
window.cpAPIInterface.
getVariableValue('How_are_you_doing_against_today_s_targets_and_why_14')+
"~~Do you have the right staff in the right places to meet demand ?~~" +
window.cpAPIInterface.
getVariableValue('Do_you_have_the_right_staff_in_the_right_places_to_meet_demand_15')+
"~~What areas would you like to improve ?~~" +
window.cpAPIInterface.
getVariableValue('What_areas_would_you_like_to_improve_16')+
"~~What are the key challenges you are currently facing and how can we solve them ?~~" +
window.cpAPIInterface.
getVariableValue('What_are_the_key_challenges_you_are_currently_facing_and_how_can_we_solve_them_17')+
"~~Additional Notes~~" +
window.cpAPIInterface.
getVariableValue('Additional_Notes_18')+
"~~DEFINE - what exactly is the problem you're facing. How will you know you have fixed it ?~~" +
window.cpAPIInterface.
getVariableValue('DEFINE___what_exactly_is_the_problem_you_re_facing__How_will_you_know_you_have_fixed_it_19')+
"~~MEASURE - what facts do you know about it ?~~" +
window.cpAPIInterface.
getVariableValue('MEASURE___what_facts_do_you_know_about_it_20')+
"~~ANALYSE - Why do you think this problem is occurring. Do you think this is the root cause ?~~" +
window.cpAPIInterface.
getVariableValue('ANALYSE___Why_do_you_think_this_problem_is_occurring__Do_you_think_this_is_the_root_cause_23')
)
var url = ("printpage.html?=" + header + args);
window.open(url,"_blank","width=800,height=600,menubar=no");
