I'm using the following code to generate an img url based on a drop down selection.
$(document).ready(function() {
$('select').change(function(){
var src = $(':selected', this).text()
$('img').attr('src', location.hostname + "/" + src + '.jpg');
});
});`
It works for showing adding the select text onto a static a url i.e. :
www.mysite.com/selecttext.jpg
But need to work for something like this:
www.mysite.com/<?php text value ?>/selecttext.jpg
The PHP is already functioning just need to know how to adjust the jquery to work.
<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>