Rich-text Reply

Testing with dynamic content

FOHtester 10-24-16

Testing with dynamic content

Hi,

 

On my website I sell customized products. In the 'customize' tool on the website you can also choose some additional options. These will be activated if you hit a checkbox. I want to set up a test where one of the checkboxes will be checked standard in stead of unchecked. When this box is checked, the price rises with 12% and this is all dynamically loaded. Do you guys have an idea how I could implement this in the right way? (meaning 1. checkbox standard checked and 2. that the 12% increase of the price loads).

 

Hope you can help me!

 

Regards,

 

Peter de Hoop

robertchan 10-24-16
 

Re: Testing with dynamic content

Sounds like you would change the attribute of the pre-selected checkbox so that it's checked then add an event listener to that checkbox. On click, have the price change by having the event trigger action on the price load.
Robert Chan

Experimentation Hero
FOHtester 10-26-16
 

Re: Testing with dynamic content

Hi Robert,

Thanks for your quick reply! As I am not advanced when it comes to coding, could you maybe give me an example of how I would implement this? I can give you the code parts of my website necessary for implementing this, if you need those.

Peter de Hoop
robertchan 10-26-16
 

Re: Testing with dynamic content

Sure, here's an example though it depends on how your checkboxes were built. Assuming you have a selector associated with the checkbox, this example would work for you:

 

$('#YOUR-CHECKBOX-ID').change(function() {
   if($(this).is(":checked")) {
      //FIRE THE EVENT THAT OCCURS WHEN THE BOX IS CHECKED
      return;
   }
   //EVENT THAT OCCURS IF THE BOX IS NOT CHECKED
});
Robert Chan

Experimentation Hero