JavaScript help!!!?
Im back again with a different error.
This time i would like to validate a selection of references made up of text and numbers.
The Javascript is as follows:
function checkcourseref (theform){
reference= document.getElementById('coursereference');
If (reference=="Intro1"){
window.open( "http://www.google.com/" )
}
ElseIf (reference=="Intro2"){
window.open( "http://www.google.com/" )
}
ElseIf (reference=="Intro3"){
window.open( "http://www.google.com/" )
there is a lot more but i can't fit it on and i know that it is a long way round of doing things but its the best way i can thing of.
Anyway the html is through a button and the code is this:
onClick="checkcourseref(document.getElementById('c oursereference'), 'Enter a valid course ID')"
When i check to see if it has worked it says that there is a problem with this line of code and there is an unexpected object.
Any ideas?
|