Reply To: Change an image based off one Select

Home Forums Quform WordPress Change an image based off one Select Reply To: Change an image based off one Select

#33614
GOMLP
Participant

No need to reply to this one, I was able to figure it out… I actually found a really good page for assisting in checking the code for missing elements and structure, URL below:

https://beautifytools.com/javascript-validator.php

My Code I got working…. You are teaching me 😉

jQuery(function ($) {
function setImageUrl() {
var foilCode = $(‘.quform-field-14_211′).val(),
foilImage = ”;

if (foilCode !== ”) {

// Black Vellum 16256
if (foilCode === ’29’) {
foilImage = ‘QuoteSubstrates/Foils/29.png’;
} else if (foilCode === ’17’) {
foilImage = ‘QuoteSubstrates/Foils/17.png’;
} else if (foilCode === ’10’) {
foilImage = ‘QuoteSubstrates/Foils/10.png’;
} else if (foilCode === ’19’) {
foilImage = ‘QuoteSubstrates/Foils/19.png’;
} else if (foilCode === ’25’) {
foilImage = ‘QuoteSubstrates/Foils/25.png’;
} else if (foilCode === ’44’) {
foilImage = ‘QuoteSubstrates/Foils/44.png’;
} else if (foilCode === ’43’) {
foilImage = ‘QuoteSubstrates/Foils/43.png’;
} else if (foilCode === ’82’) {
foilImage = ‘QuoteSubstrates/Foils/82.png’;
}

} else {
foilImage = ‘QuoteSubstrates/empty.png’;
}

$(‘#foiling-Image’).attr(‘src’, ‘http://gomlp.biz/wp-content/’ + foilImage);
}

$(‘.quform-field-14_211’).on(‘change’, setImageUrl);
});

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