|
|||||||
| JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...) |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have this login coder, that I cannot seem to get to open in a new page. I have tried everything that I know of, can anyone help??
<tr><td>Municipality:</td><td><select name=memlist> <option value='x'> <option value='Algonquin|31587|JPHPQSXR'>Algonquin <option value='Barrington|25311|FDYYPQIT'>Barrington <option value='Bull Valley|50655|CDRSYCSS'>Bull Valley <option value='Cary|52065|DJXCJQOI'>Cary <option value='Crystal Lake|52065|DAEWUFOL'>Crystal Lake <option value='Fox River Grove|50711|GUFTKCIS'>Fox River Grove <option value='Harvard|50711|IGZXCYHJ'>Harvard <option value='Hebron|17020|IMEZVOOU'>Hebron <option value='Holiday Hills|59921|JUNJGEZP'>Holiday Hills <option value='Huntley|7030|KUNVNFDN'>Huntley <option value='Island Lake|13371|JWNDSENE'>Island Lake <option value='Johnsburg|3468|RUOOUCUR'>Johnsburg <option value='Lake In The Hills|3027|UGKENILL'>Lake In The Hills <option value='Lakemoor|2954|MCKENPTR'>Lakemoor <option value='Lakewood|27846|RARICQOG'>Lakewood <option value='Marengo|21519|SIXFOMOI'>Marengo <option value='McCullom Lake|28398|UCCXLNQO'>McCullom Lake <option value='McHenry|42256|NGMMOSGJ'>McHenry <option value='Oakwood Hills|5027|PJLWQXHI'>Oakwood Hills <option value='Port Barrington|66327|RRTWBBZX'>Port Barrington <option value='Prairie Grove|14724|QZBRRKFG'>Prairie Grove <option value='Richmond|74845|TPHJPORF'>Richmond <option value='Spring Grove|32058|TSTKPIPR'>Spring Grove <option value='Union|31410|VOQPQORL'>Union <option value='Wonder Lake|27598|DOPFHTMD'>Wonder Lake <option value='Woodstock|63422|YTQKYZOH'>Woodstock <option value='McHenry County Sherrif|20783|OUMESLGG'>McHenry County Sherrif <option value='Illinois State Police|10569|JNMPWOJU'>Illinois State Police </select></td></tr> <tr><td>Password:</td><td><input type=password size=10 maxlength=8 name=pass></td></tr> <tr><td colspan=2 align=center><input type=button value="Login" onclick="window.open(check(this.form))"></td> </tr> </table> </form> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var params=new Array(4); var alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI"; function check(form) { which=form.memlist.selectedIndex; choice = form.memlist.options[which].value+"|"; if (choice=="x|") { alert("Please Select Your Name From The List"); return; } p=0; for (i=0;i<3;i++) { a=choice.indexOf("|",p); params[i]=choice.substring(a,p); p=a+1; } h1=makehash(form.pass.value,3); h2=makehash(form.pass.value,10)+" "; if (h1!=params[1]) { alert("Incorrect Password!"); return; }; var page=""; for (var i=0;i<8;i++) { letter=params[2].substring(i,i+1) ul=letter.toUpperCase(); a=alpha.indexOf(ul,0); a-=(h2.substring(i,i+1)*1); if (a<0) a+=26; page+=alpha.substring(a,a+1); }; top.location=page.toLowerCase()+".html"; } function makehash(pw,mult) { pass=pw.toUpperCase(); hash=0; for (i=0;i<8;i++) { letter=pass.substring(i,i+1); c=alpha.indexOf(letter,0)+1; hash=hash*mult+c; } return(hash); } // End --> </script> |
|
#2
|
|||
|
|||
|
This:
onclick="window.open(check(this.form))" should be just this: onclick="return check(this.form)" and this: top.location=page.toLowerCase()+".html"; should be this: window.open(page.toLowerCase()+".html"); |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|