Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

multiple numeric and price values

  • gstlouis
  • gstlouis's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 3 months ago #128816 by gstlouis
multiple numeric and price values was created by gstlouis
I would like to create items that are multiple numeric, add javascript that will show prices to the items that will update on how many items are chosen. I would like to capture the item values and the prices associated to this.

Is this possible using limesurvey?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 3 months ago #128829 by tpartner
Replied by tpartner on topic multiple numeric and price values
Sorry, I don't get what you are trying to do. can you provide a visual mockup?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • gstlouis
  • gstlouis's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 3 months ago #128838 by gstlouis
Replied by gstlouis on topic multiple numeric and price values
sure thing


// Insert the images into the labels
//image values are dollar amounts
$( 'label[for="answer926991X59X530A1"]' ).html( "<img value='20' item-name='bathtowels' src='{TEMPLATEURL}BATHTOWELS.png'/>" );
$( 'label[for="answer926991X59X530A2"]' ).html( "<img value='10' item-name ='handtowels' src='{TEMPLATEURL}HANDTOWELS.png'/>" );
$( 'label[for="answer926991X59X530A3"]' ).html( "<img value='0' item-name='washcloth' src='{TEMPLATEURL}WASHCLOTH.png'/>" );

//insert a new element to display dollar amount
$( '.slider-button-up' ).each(function(){
$( this ).after( "<span class='total'></span>" );
$( this ).after( "<span class='itemVal'></span>" );
}); //END OF EACH


//add a button slider
$('#question{QID}').sliderButtons({
downText: '-', // Text for the "down" button ejp. .down is a class
upText: '+', // Text for the "up" button .up is a class
scrolling: false, // Continuous slider movement if left mouse button held down
scrollInterval: 250, // Interval (in ms) between slider movement when button is held down
valueSuffix: "", // Suffix for callout

});



so basically I have a function that on click of buttons it gathers the price value and multiplies by its respective item for display price
Lime is capturing the value of the item for the survey but now I can asked to capture the price value as well for a DB entry.

What do you recommend my best approach would be?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 3 months ago #128841 by tpartner
Replied by tpartner on topic multiple numeric and price values
Well, that is hardly a visual mockup and appears to be a mashup of several workarounds/plugins.

It seems to me that you would need a hidden multiple-short-text question and then modify the jQuery UI slider "change" event to populate that accordingly.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose