-1

I'm hoping someone can point me in the right direction. I've searched Google for hours, but may not searching with the correct terminology. What I need is super simple. I need an check box that a user must check before clicking the submit button.

If the check box is checked then it will redirect the user to a specific webpage. My issues is with the java script. I'm not sure how to set the "IF" and "ELSE" statements. If anyone can provide a link or a quick simple example it would be super appreciated.

Thanks in advance.

0

1 Answer 1

1

Try this

if (document.getElementById('checboxid').checked) {
    document.getElementById("buttonid").onclick = function() { 
        window.location.href = 'http://something.com'; 
    };
} else {
   alert("not checked");
}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.