Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

233
Views
Change the width of jQuery UI dialog in Qualtrics

im programming a survery in Qualtrics. I want to code a clickable button, that shows some text in a box.

The codes I used are:

In the Qualtrics survey-header:

<link href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet" />
<script src="//code.jquery.com/jquery-1.12.4.js">    </script>
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.js">    </script>
<script>
        jQuery("[id*='dialog']" ).dialog({ autoOpen: false});  
        jQuery('body').on('click','.ui-widget-overlay',function(){ jQuery("[id*='dialog']").dialog('close'); });
                            </script>

JS in the specific question:

Qualtrics.SurveyEngine.addOnload(function()
{
jQuery("#btn1").click(function() {
jQuery("#dialog").dialog( "option", "modal", true);
jQuery("#dialog").dialog( "open", "width", 500).css({

"padding":"0px"
});
   })
});

HTML in the question text:

<button id="btn1"> BUTTON TEXT </button><br>
<span title="MOD Explanation" id="dialog"> TEXT IN BOX</span>

However, I cannot change the width of the box. I would like it to spread about 60% over screen with a min-width of 450px.

Thanks for any help!

Best, Tim

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Comment explains how to do it, not sure what Qualtrics.SurveyEngine.addOnload is, api here: https://api.jqueryui.com/dialog/

$(document).ready(function() {
  jQuery("#btn1").click(function() {
    jQuery("#dialog").dialog({modal: true, width: "60%", minWidth: 450}); // you need to pass object here docs: https://api.jqueryui.com/dialog/
  })
})
<html>

<head>

  <script src="//code.jquery.com/jquery-1.12.4.js"></script>
  <script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</head>

<body>
  <button id="btn1"> BUTTON TEXT </button><br>
  <span title="MOD Explanation" id="dialog"> TEXT IN BOX</span>
</body>

</html>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!