Forum Moderators: open
function formSubmit(formName){
var start_year = document.search.start_year.value;
var start_month = document.search.start_month.value;
var start_day = document.search.start_day.value;
var duration = document.search.duration.value;
var targetresult="date_search_results.php?start_year="+start_year;
window.open(targetresult, 'none', 'scrollbars=1,width=590,height=520');
}
I want to add the month, day and duration to the targetresult bit, have tried a few ways but not sure why it keeps erroring, obviousley where I am putting "" in is incorrect
var targetresult = "date_search_results.php?" +
"start_year=" + encodeURIComponent(start_year) +
"&start_month=" + encodeURIComponent(start_month) +
"&start_day=" + encodeURIComponent(start_day) +
"&duration=" + encodeURIComponent(duration);
Hope that helps.