question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Show Message based on previous selected item

See original GitHub issue

Are you requesting a feature, reporting a bug or asking a question?

Question

What is the current behavior?

I’m using smarty to show date of the selected item only (checkbox or dropdown)

but the messages display the information of all item, even those are not selected

What is the expected behavior?

I would like to display the information for only the selected item

How would you reproduce the current behavior (if this is a bug)?

Provide the test code and the tested page URL (if applicable)

Tested page URL:

https://i.im.ge/2022/06/23/uXGcBW.gif


{literal}
        <script type="text/javascript">Survey
    .StylesManager
    .applyTheme("defaultV2");

var json = {
  "pages": [
    {
      "locale": "fr",
      "name": "page1",
      "elements": [
              {
         "type": "radiogroup",
          "name": "Commandes",
         "isRequired": true,
         "title": "Merci de choisir la commande",
          "colCount": 3,
          "choicesOrder": "asc",
          "choices": [ {/literal}  {foreach from=$orders item=order}
            "{$order.details.reference}",
        
          {/foreach}{literal}  ]
        },{
             
     "type": "html",
     "name": "DétailsCommande",
       "isRequired": false,
        "visibleIf": "{Commandes.length} > 1",
        "title": " ",
        "choicesFromQuestion": "Commandes",
         "choicesFromQuestionMode": "selected",
<!--it should shows the order date of the selected   "name": "Commandes"-->
     "html": "{/literal}  {foreach from=$orders item=order} {$order.details.order_date}{/foreach}{literal}"
    },

Specify your

  • browser:Chrome
  • browser version:Version 102.0.5005.115 (Official Build) (64-bit)
  • surveyjs platform jquery
  • surveyjs version:1.9.2

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewtelnovcommented, Jun 27, 2022

@go-sudo opSystem should be “checkbox”. Here is the updated example You are requested opSystem value to be an array.

Thank you, Andrew

0reactions
go-sudocommented, Jul 3, 2022

Hi @andrewtelnov

Thanks to you, I Found a solution to my issue, I appreciate your help

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found