Results 1 to 1 of 1
Hi guys,
A friend has given me some javascript but I don't know much about Javascript as I only do CSS/HTML. What I want to know is how to incorporate ...
- 12-09-2011 #1Just Joined!
- Join Date
- Oct 2008
- Location
- Edinburgh, Scotland
- Posts
- 18
HTML/Javascript issue
Hi guys,
A friend has given me some javascript but I don't know much about Javascript as I only do CSS/HTML. What I want to know is how to incorporate it into my Home Page.
the script is:
The story is I have a custom button which links to say page A, what I wanted was 2 checkboxes that when either is checked the button will go to page B or page C.Code:document.getElementById('gotoform').addEventListener('submit', function(e) { for (var goto = '', i = 0; i < this.goto.length; i++) { if (this.goto[i].checked) { goto = this.goto[i].value; break; } } if (goto === 'admin') { document.location = 'admin.php'; } else if (goto === 'home') { document.location = 'index.php'; } else { alert('Invalid input'); } e.preventDefault();
Any ideas?


Reply With Quote