Okay
  Public Ticket #3001320
items in items?
Closed

Comments

  • Kaj started the conversation

    Hi!
    I need to create items with questions and in one question I need to give posibilitys to chooce 2 - 4 answers. So my question is if its possible to create items field in items field? So I can choose witch- and how many answare its should be on eatch of my questions in admin?

  •  1,175
    Amit replied

    sorry we dont have that option

  • Kaj replied

    I would like to build similar to this screenshot. There you choose question and answare (2-4 answare). Du you see any solution to that? Is there possible on any way to have radio-buttons and in back-end I have forexample 4 text-field, and if one or more is emty then hide that input?

  •  1,175
    Amit replied

    i dont i am sorry 


  • Kaj replied

    What do you meen with "i dont"? Is there anyone else there who maybe could help me? This is important, realy!

  •  1,175
    Amit replied

    We dont have any form solutions. If i could help ofcourse i would help you. 


  • Kaj replied

    Im not talking about form solutions! I just see if its any work around this. For example if i leave empty text-field can I hide one of inputs with css or something?

  •  1,175
  • Kaj replied

    So you had a solution? ;)
    Thank you!

  • Kaj replied

    Can I have dynamic id in items? So when I create new item it get random id?

  •  1,175
    Amit replied

    its called 

    {{item.item_id}}

  • Kaj replied

    Im not geting "if empty" statement to work?

    I send you a screenshot. Do I do anything wrong?

  •   Max replied privately
  • Kaj replied

    "fraga" is the name of the text-field.


    The inlogg to the site is:
    Url: https://foreldrelandsbyen.viralmedia.no/wp-admin/
    user: support
    password: EWQIPaLZL6Fu59(o@Dy9qLh8

  •   Max replied privately
  • Kaj replied

    Its on this page:
    https://foreldrelandsbyen.viralmedia.no/test/
    And the name of the widget is: Calcylator

  • Kaj replied

    Like you see I have 4 radio buttons as answare on a questions. Im thinking to have 4 text-field in the item, who is text for this answare. My goal is if some of this text-field is empty I want to hide that radio-button.

  • Kaj replied

    Have you been in on the wordpress site?

  •   Max replied privately
  • Kaj replied

    Hi Max!

    I try if else but its not working eather?
    Is there anything wrong in my wordpress who does its not working? It should work in javascript file also?


    Best regards,
    Kaj

  • Kaj replied

    Do I need to have only html in the condition? or can I have javascript too?

  •   Max replied privately
  • Kaj replied

    Hi Max!
    Thanks for answare!

    Other thing ..
    How can I isolate my widgets? So if I can have multi same widgets on One page without thay iteract with eatchother?

  •   Max replied privately
  • Kaj replied

    But if I have multi selectors in my js I need to isolate. Its seems to be same id? And not working?
    I would appreciate if you would help me with this, I have deadline after few hours

  •   Max replied privately
  • Kaj replied

    Ok, thankyou so Max!

    This is the end page:
    https://foreldrelandsbyen.viralmedia.no/erstatningstesten/
    Like you see its four buttons who goes to popups and there I have the widget Im trying to crate. Its a form-based calculator, who based on created question and ansvare and probability in scale from 1-10 gives then a statistics animasion and answare. I think I have work out the widget and got it to work like it should. But the only problem I have now is that its not isolated, so if I have two or three of this widget on the same page (witch I need) so begins the forms interact with eathother and the statistic answares whent to be wrong.

    Here is the link to the popups;
    https://foreldrelandsbyen.viralmedia.no/wp-admin/edit.php?post_type=jet-popup

    And the widgets name is: Calculator

    The inlog page is:
    https://foreldrelandsbyen.viralmedia.no/wp-login.php
    Username:
    support
    Password:
    support123

    I really like your plugin and can see the potential and really want to learn more!

    Best regards;
    Kaj

  •   Max replied privately
  • Kaj replied

    Ok, thanks Max!

    So example..
    Instead of doing:
    var responseDiv = jQuery("#myResultContainer");
    I do
    var responseDiv = objCalculator.find("#myResultContainer");

    Have I understod you right?

  • Kaj replied

    What about the tings in css- and html file then?

  • Kaj replied

    Also I have a function in my javascript who looks like this:

    jQuery("input.QuestionFieldvalue:checked").each(function () {
         
        var name = jQuery(this).attr("name");
        var myMaxScore = parseInt(jQuery(this).attr("data-max-score"));
        var score = parseInt(jQuery(this).attr("data-score"));
        var response = jQuery(this).attr("data-return-text");

        if (response) {
          responseParagraphs.push(response);
        }

        totalScore = totalScore + score;
        
        maxScore = maxScore + myMaxScore;
        
        percent = (totalScore * 100) / maxScore;
      });

    Like you see its take info from html- attribut. How do I do in this case?


    Best ragards,
    Kaj


  • Kaj replied

    When I paste the code in Visual Studio Code editor, I got wrong on this place?


  •   Max replied privately