Reply To: Display data from a field on a previous page

Home Forums Quform WordPress Display data from a field on a previous page Reply To: Display data from a field on a previous page

#34326
MOVOX
Participant

Hi Ally,

I’ve added a new tag in the HTML element and changed the code as suggested. The image is displaying OK but the Label isn’t displayed.

The HTML looks like:

<span id=”stage-value”></span>
<span id=”stage-value-text”></span>

And the JS code looks like (please note that I’ve used a false URL for the image.):

$(‘.quform-field-10_167’).click(function() {
var value = $(this).val(),
url;

if (value === ‘Option 1’) {
url = ‘https://abc.com/wp-content/uploads/2019/04/concept_000044.png&#8217;;
} else if (value === ‘Option 2’) {
url = ‘https://abc.com/wp-content/uploads/2019/04/startup_000044-1.png&#8217;;
} else if (value === ‘Option 3’) {
url = ‘https://abc.com/wp-content/uploads/2019/04/growth_000044.png&#8217;;
} else if (value === ‘Option 4’) {
url = ‘https://abc.com/wp-content/uploads/2019/04/presentation_000044.png&#8217;;
} else if (value === ‘Option 5’) {
url = ‘https://abc.com/wp-content/uploads/2019/04/expand_000044.png&#8217;;
}

if (url) {
$(‘#stage-value’).html($(‘‘).attr(‘src’, url));
} else {
$(‘#stage-value’).html(”);
}

$(‘#stage-value-text’).text($(this).closest(‘.quform-option’).find(‘.quform-option-text’).text());
});
});

Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy