I am trying to use the code hidePreviousButton () to hide the back button in Qualtrics. Currently, I have added the back button on all questions using the Survey Options, and I would like to remove the back button on certain pages.
If there is not a way to do that, then I would be equally open to adding the back button on select pages using JavaScript as well.
Thank you for any assistance!
To hide the previous button, you can use:
this.hidePreviousButton ()
So the full code screen should look like this:
`Qualtrics.SurveyEngine.addOnload(function()
{
this.hidePreviousButton ()
});
`
I found this in the API Qualtrics page, but there it forgets to tell you that you need to include "this." before any of the commands that it gives you. At least, adding that code before the command worked for the ones I tried.
The API page for Qualtrics is actually inaccurate, unfortunately it needs a few updates. The current way to do this, is by adding:
$('.PreviousButton').hide();
to the JavaScript for any question you want to hide it for.
Related
I have created custom Issue Tab Panel with field, where I can add comment when Ill press my custom button “add comment”
In my VM template I have
AJS.$("#add-comment-button").click(function(e) {
e.preventDefault();
AJS.dialog2("#add-status-comment").show();
});
This button works fine and window to write text appears, but… In other section in Issues --> Current Search —> Views (Detail Views), windows with space to write text dont appear when I click button “add comment”. It only appers in normal view of issue… Whats problem?
I'm not sure if I understand your question right so I'll give it a try. Maybe it helps in one or the other way.
As you didn't provide the code affecting the window I assume it is possible you are retrieving the issue key or issue id. There are some Jira JS calls that don't work in every view. The reason is unknown to me, but maybe if you use different calls it will work.
Here is the question and answer to this field availability problem on the atlassian community: https://community.atlassian.com/t5/Jira-questions/Get-issueID-in-JavaScript-in-Project-Screen-viewing-issue/qaq-p/824175
Otherwise you should provide some more information.
Regards
Chris
A few months ago I used the excellent advice over here to create a survey in Qualtrics with some javascript code that saved people's responses (given by moving a slider) as embedded data. It all hinges on being able to call some functions when the "Next" button is clicked, as is found under $('NextButton').onclick = function (event) in the above link.
I wanted to reuse that survey this weekend, and found that the data was no longer being saved. After fiddling around a bit, I realised that currently, any such function will now only be run the first time the "next" button is clicked, and not on any subsequent time. In other words, precisely the same javascript will either work or do nothing depending on whether it happens to be the first time the next button is clicked.
I mailed Qualtrics asking for advice, and their support person mailed back with the following:
The old application that ran our surveys would reload the page each time you went to a new page in the survey. The current application that runs our surveys is a one page app and going to the next page in a survey does not refresh that entire page, it just presents a different section.
I couldn't find anything on the Qualtrics website giving more information about the aforementioned update, or indicating whether there's a new CSS selector that could be used to select the currently-displayed "next" button, replacing $("NextButton"), and I have no idea how to reverse engineer a Qualtrics survey web page to work it out for myself.
Can anyone suggest how the code in the linked answer above might be altered to work on the updated Qualtrics platform? Or can anyone confirm whether their old code still works, in which case I'm mis-identifying what the problem is.
I have insufficient reputation to comment on the above-linked solution to point out this issue, but perhaps someone else could do so. I'll update this if I get any more information from Qualtrics support.
Qualtrics uses two survey engines: the older SE and the newer JFE. Qualtrics Support was referring to JFE. You can force Qualtrics to use SE by adding the parameter Q_JFE=0 to your survey link. That might be a quick fix.
That said, adding an event listener to the NextButton has never worked reliably with either SE or JFE. Qualtrics has its own event listeners on the Next Button that interfere. The most reliable method is to use JavaScript to hide the NextButton, then add your own button that performs any process you need, then at the end clicks NextButton. See example here.
I haven't tried T. Gibbon's Q_JFE=0 suggestion above, and the suggestion to hide the Next button didn't work for me (though it's possible this was just because I did it wrong - perhaps someone could comment if it worked for them).
When I mailed Qualtrics, their suggestion was to add an event listener as follows, and then remove it before applying another.
document.getElementById('NextButton').addEventListener(function (event) {
doStuff();
});
However, since I'm just a psychologist who wants to get data quickly rather than a javascript programmer, I wasn't sure just how to go about 'removing an event listener', and decided to try what I thought was a simpler solution, in that it doesn't rely on having some functions run when the 'next' button is clicked.
For each question that contains a slider whose data I want to save (I had just one such question per page), I included the following, to save the ID for that particular question as embedded data. Each question's ID is saved with a unique tag ('q1ID' in the following). I had one such question per page.
Qualtrics.SurveyEngine.setEmbeddedData('q1ID', this.getQuestionInfo().QuestionID);
Then once all the slider-type questions had been presented, on the following page I included this code:
Qualtrics.SurveyEngine.addOnload(function()
{
var tags = ['q1','q2', 'q3'];
var pipedStrings = {'QID356':'${q://QID356/TotalSum}',
'QID357':'${q://QID357/TotalSum}',
'QID358':'${q://QID358/TotalSum}'};
tags.forEach(function(tag) {
var qID = Qualtrics.SurveyEngine.getEmbeddedData(tag + 'ID');
var response = pipedStrings[qID];
Qualtrics.SurveyEngine.setEmbeddedData(tag, response);
});
});
Initially, I'd tried what I thought was more sensible:
tags.forEach(function(tag) {
var qID = Qualtrics.SurveyEngine.getEmbeddedData(tag + 'ID');
var response = '${q://' + qID + '/TotalSum}';
Qualtrics.SurveyEngine.setEmbeddedData(tag, response);
});
But as pointed out here, Qualtrics won't allow you to fetch data by concatenating a variable into a string like this. Consequently, even though it seems a ridiculously roundabout what to do it, I created the pipedStrings object that has a list of all the question IDs I needed (which I found by exporting the survey to a text file and searching for my question tags).
This allowed me to save the responses to slider questions as embedded data, with the keys listed in tags. If anyone has a simpler approach, avoiding have to create the dictionary of pre-formatted strings, please do comment.
I'm using introjs.
But when a user ends the intro, then refreshes the page, introjs starts up again.
Is there a way to only show a walkthrough once per user?
For example I have it where when a user first signs into my website - introjs will popup. I only want it to pop up for that initial welcome.
Potential Solutions
Maybe there is a way to trigger introjs via the create action like one would with a flash message?
I could replicate all my header, sidebar, and challenges section code into pages/tutorial.html.erb and make a route www.websitename.com/tutorial, but then that would be a lot of code to duplicate and then whenever I change something in the site I would have to change it in tutorial too.
Is there a way to adjust this javascript method in application.js to trigger only once per user $(function () {
introJs().start() })?
I just use data-intro="" for each step of the walkthrough.
You want your application/webpage to remember that the user has already gone through your tutorial.
There are a few ways you can do that. For a start, you can use cookies or localStorage
The gist is that after the user finishes, or otherwise exits your tutorial, you can store a descriptive value to the user's client, by using one of the above methods, and on page load you should first check if this value exists and act accordingly.
EDIT: As mentioned in comments, you will need a server side approach as well.
I'm putting up a "special offer" on my website where if users like my website via a facebook like button, then can access a special form where they can ask me to look at their website and other stuff. I can't seem to find an easy way to do this without getting into the facebook api. So basically, is there a way to reveal an element (#ask_form) when the + like part of the facebook like button is clicked? (.connect_widget_like_button clearfix, .like_button_like) Any responses would be helpful. If there's a way to do this with the FB API where if a user unlikes it it would go away and have more features that'd be cool to. I look forward to reading your responses.
You don't need jQuery for that. Have a look at the 1st and 2nd answer from this question.
$(buttonselector).on('click', function () {
$(hiddenformselector).show();
});
that's assuming the hidden form starts as display:none;
Sorry I'm not familiar with the face book api but this would cause the form to show when that button was clicked
Try it: Like 2 Unlock for Jquery
im a backend programmer who wants to have a window that appears in front of the current window when clicking "register".
so that you dont have to redirect to another page.
i think u guys know what i mean.
how do i do that? is it with jquery or javascript? is ajax involved?
and what is that kind of popup box called?
You want to write a div into your HTML that contains your login fields (i.e. the popup window). Set it to position:absolute; and position with CSS so it floats above the page contents and doesn't interrupt the flow when it appears. Get it all nice and positioned where you want it, then set it to display: none; so it will wait for javascript to make it appear.
Then (using jQuery), write something like this:
$('#register').click(function() {
$('#popup').show();
});
where #register is whatever gets clicked (can be most anything with id="register").
What happens whenever that form is submitted is up to you, and not any different from the options you'd have with any other HTML form. jQuery can help with AJAX if you decide to go that route and not send the surfer to another page to process the form.
It can be done using quite a few totally different approaches. As Sam said it's the concept of modal boxes.
You could do it completely on the client side using CSS and JavaScript (alternative), or via AJAX and some third-party libs.
Try being a bit more specific - what's the the backend/frontend environment? Is performance an issue (eg. minimal client-server communication)?
I believe you're referring to a modal form. You can search for modal popup javascript. There is a good javascript component called Lightbox that will help as well.
EDIT:
I mentioned Lightbox, but Lightbox Gone Wild is the one I meant. As others have pointed out, using a modal tool like this all you do is write the html you want to be displayed in the modal popup. That link is a good tutorial on the concept and explains things well.