Hi, Can someone help me with this: <input type="submit" name="Submit" value="Find" onclick="location.href="http://www.web.co.uk/" + document.getElementById("service").value + "/" + document.getElementById("location").value + "/";"/> Code (markup): It does not seem to work but cannot see what is wrong with it. Cheers, Adam
There is syntax error there because the quotes are not properly enclosed/used. Try this: <input type="submit" name="Submit" value="Find" onclick="location.href='http://www.web.co.uk/' + document.getElementById('service').value + '/' + document.getElementById('location').value + '/';" /> Code (markup):
You also might want to consider putting that code into the <form> tag (but use onsubmit instead of onclick), and follow it up with a return false; to make sure the form doesn't accidentally get posted. For example: <form onsubmit="location.href='http://www.web.co.uk/' + document.getElementById('service').value + '/' + document.getElementById('location').value + '/'; return false;"> Code (markup):
Thanks this works fine now, What i need to do, and i don't know if this is possible but i need when a selection is made i need that selection if contains spaces for the spaces to be removed and replaced with - also i need the address to be changed to all lowercase. Can this be done, if so how?