Checked Box
Checked Box
Hi,
I have a form setup and working and sending to a thankyou page in PHP.
I am now looking to having a javascript function to say if it is checked on submit then redirect to this page instead, I have got this piece of code which doesn't work, am I along the right track or does anyone have some better code for me?
<script type="text/javascript">
$("form").submit(function() {
if ( $("#00N20000002Bra2").is(":checked") ) { location.href = "http://www.google.co.uk"; } else { location.href = "http://www.bbc.co.uk"; }
});
</script>
I am in need of it using Javascript and not PHP, can anyone help?
Thanks
Craig