Extracting Data entry using Javascript

Hi

I'm sure that this is relatively easily to do but I'm struggling to work it out and I'm hoping someone is able to help.

I have a feedback form within my course with 4 data entry boxes and a submit button. The data entry boxes all have variables assigned to them, 'Name', 'Email', ContactNumber' & 'Message'

What I would like to do is extract the information from the text boxes using a JavaScript trigger when the submit button  is pressed,  and then put it into the main body of an email. I would also like to be able to have my email address and the Subject field of the email populate automatically with the course name.

I haven't used JavaScript before which is probably the reason I struggling with this so much so I would really appreciate any help.

Thanks

2 Replies
Bruce Holliday

Hi,

This should be everything you need, check out the javascript execute on the submit button for slide 5.

I found this in the forum a few weeks ago. You could too if the Serach tool was working....

var player = GetPlayer();

var useremail=player.GetVar("email");

var subject="VAE Engagement sur l' utilisation de velos a assistance Electrique";

var usernotes=player.GetVar("Note");

var exercisenotes1=player.GetVar("Note1");

var exercisenotes2=player.GetVar("Note2");

var exercisenotes3=player.GetVar("Note3");

var mailto_link='mailto:'+useremail+'?subject='+subject+'&body='+"Activity Notes - My thoughts on the Non-Discrimination policy:%0d%0A"+exercisenotes1+"%0d%0A%0d%0AActivity Notes - Situations I would report to the Values Line:%0d%0A"+exercisenotes2+"%0d%0A%0d%0AActivity Notes - Examples of Conflict of Interest situations:%0d%0A"+exercisenotes3+"%0d%0A%0d%0AGeneral Notes:%0d%0A"+usernotes;

win=window.open(mailto_link,'emailWin');