I need to change a couple of href parameters using jQuery and driven by two form select options. The below example works perfectly but is driven from a text input and having problems converting it to work with a select.
https://stackoverflow.com/a/6540265/460322
I know this shouldn't be too hard but I have a stinking cold and brain is like mush this morning!
My code so far that doesn't work:
$(window).load(function(){
function updateNameValue() {
$('#changelink').val($('#option1 option:selected').attr('href', function(i,a){
return a.replace( /(field16=)[a-z]+/ig, '$1'.target.value ));
});
});
$('#option1').change(updateNameValue);
updateNameValue();
});