si have the following script:
function getInputString() {
//dropdown value
$('#dropdown').bind('change', function(event) {
var dValues = $('#dropdown:selected').val();
//the standard form should hide if nothing is choosen
if("" != dValues) {
$('.shop_search').hide();
}else {
$('.shop_search').show();
}
//if first 2 letters are not MZ cValue changes, else it is the selected one
if (dValues.substr(0, 2) != "MZ") {
var cValues = "simson " + dValues;
}else {
var cValues = dValues;
}
});
return cValues ;
}
function getSearchString() {
//searchform value
$('#merkmalsuche').keyup(function () {
var sValues = $(this).val();
}).keyup();
return sValues;
}
function generateURL() {
var mString = getSearchString();
var vString = getInputString();
window.location = "http://www.akf-shop.de/tag/" + vString + " " + mString;
}
$('#merkmalsuche').submit(function() { generateURL(); });
There is a generated select with options, setting the first var. On change, the normal search form should hide and a mirror search form is displayed. On keyup, the entered word is the second var.
If you click on submit you now should get linked to a generated URL.
But if change a value in the select field, nothing happens.
Thank you
Nothing happens because calling the two functions
is just going to assing the handlers ..
Also you will have error on the page as cValues is not defined outside the function scope.. It will be local to the event handler ..