Home › Forums › Quform WordPress › Display data from a field on a previous page › Reply To: Display data from a field on a previous page
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’;
} else if (value === ‘Option 2’) {
url = ‘https://abc.com/wp-content/uploads/2019/04/startup_000044-1.png’;
} else if (value === ‘Option 3’) {
url = ‘https://abc.com/wp-content/uploads/2019/04/growth_000044.png’;
} else if (value === ‘Option 4’) {
url = ‘https://abc.com/wp-content/uploads/2019/04/presentation_000044.png’;
} else if (value === ‘Option 5’) {
url = ‘https://abc.com/wp-content/uploads/2019/04/expand_000044.png’;
}
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());
});
});