I’m not sure I completely understand what you’re trying to do, but this ought to get you started:
function appendDateTo(url) {
url += document.getElementById('month').value;
url += document.getElementById('day').value;
url += document.getElementById('year').value;
return url;
}
This snippet assumes that your date fields are given 'month', 'day', and 'year' id
s. If you want to redirect to the returned URL, you would write something like this:
function redirectTo(url, options) {
if(options.append_date) {
window.location = appendDateTo(url);
} else {
window.location = url;
}
return true;
}
Your HTML would need to contain a link like this:
<a href="javascript:redirectTo('http://www.shivian.com/controller/action?date=', {append_date : true});">Redirect</a>
Is your test code up on the web somewhere? The question would be a lot easier to answer if I could see exactly what you were trying to do.