...

View Full Version : Script doesn't seem to be running



zipster1967
01-03-2012, 03:17 PM
Okay I am sure my script is loading when the page loads because of the alert box I have added but when I click on the button that is suppose to activate the script nothing happens.
The button code is as follows:
<button type="button" name="submit" value="submit" class="css3button" onclick="send(nick,passwd,userid,chan,showtime,showjoin,showpart,showquit,fname,fsize,nnick1,nnick2,nnick3,nn ick4,nnick5)">Connect</button>
I may be using the button wrong but I am new to javascript. Any suggestions would help.

xelawho
01-03-2012, 03:22 PM
hard to say without seeing the rest of your code.

what does the error console say?

Amphiluke
01-03-2012, 03:46 PM
The first potential source of errors is that the button's name is set to "submit", which in fact makes programmatic form sending impossible.

DaveyErwin
01-03-2012, 03:58 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="generator" content="daveyerwin">
<title>Untitled</title>
<script type="text/javascript">
var nick,passwd,userid,chan,showtime,showjoin,showpart,showquit,fname,fsize,nnick1,nnick2, nnick3,nnick4,nnick5=""
function send(){
alert('Hello')
}
</script>
</head>
<body>

<button type="button" name="submit" value="submit" class="css3button" onclick="send(nick,passwd,userid,chan,showtime,showjoin,showpart,showquit,fname,fsize,nnick1,nnick2, nnick3,nnick4,nnick5)">Connect</button>

</body>
</html>


</body>
</html>

zipster1967
01-03-2012, 04:50 PM
There is no error codes. It just sits there. I don't think the script is even running when the button is clicked. I will post the html page


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="keywords" content="Javascript login form for IRC using PJirc" />
<meta name="author" content="Trent Perez: trentjp@perezcomputer.com" />
<title>Enchatment Java Login</title>
<!--[if IE]>
<style type="text/css">
#theform #pt4 {
padding: 2em 1em 1em 1em;
}
</style>
<![endif]-->
<link rel="stylesheet" type="text/css" href="IRCloginform.css" /></style>
<script type="text/javascript" src="ircchat.js">
</script>
</head>
<body>
<h1 class="title">Enchatment Chat Home</h1>
<h2 class="subtitle">Chat Client (May take up to a minute to load)</h2>
<h2 class="subtitle2">NOTE: If your Popup blocker is stopping Chat opening hold down Ctrl key while clicking Connect</h2>
<form id="theform" action="send(nick,passwd,userid,chan,showtime,showjoin,showpart,showquit,fname,fsize,nnick1,nnick2,nnick3,nn ick4,nnick5)" enctype="multipart/form-data" method="post">
<fieldset id="pt1">
<label for="nick">Nickname</label>
<input type="text" id="nick" tabindex="1" />
<label for="userid">Gender/Orientation</label>
<select name="userid" tabindex="3">
<option value="Male selected="selected"">Male</option>
<option value="Female">Female</option>
<option value="Bi-Male">Bi-Male</option>
<option value="Bi-Female">Bi-Female</option>
<option value="TS-Male">Transsexual Male</option>
<option value="TS-Female">Transsexual Female</option>
</select>
</fieldset>
<fieldset id="pt2">
<label for="password">Password</label>
<input type="password" id="passwd" tabindex="2" />
<label for="chan">Channel to join</label>
<select name="chan" tabindex="4">
<option value="#Sweetoasis" selected="selected">#Sweetoasis</option>
<option value="#Sweetoasis_Help">#Sweetoasis_Help</option>
<option value="#Sweetoasis_Radio">#Sweetoasis_Radio</option>
</select>
</fieldset>
<fieldset id="pt3">
<div id="buttoncontainer">
<button type="button" name="submit" value="submit" class="css3button" onclick="send(nick,passwd,userid,chan,showtime,showjoin,showpart,showquit,fname,fsize,nnick1,nnick2,nnick3,nn ick4,nnick5)">Connect</button>
</div>
</fieldset>
<fieldset id="pt4">
<h2 class="subtitle">Advanced Settings (Not Required)</h2>
</fieldset>
<fieldset id="pt5">
<label for="showtime"><input type="checkbox" id="showtime" name="showtime" tabindex="5"/>Show Time Stamps</label>
<label for="showjoin"><input type="checkbox" id="showjoin" name="showjoin" tabindex="7"/>Show Joins</label>
<label for="fname">Font Name/Size</ label>
<select name="fname" tabindex="9">
<option value="monospaced">Monospaced</option>
<option value="dialog">Dialog</option>
<option value="dialog Input">Monospaced</option>
<option value="sanserif">SanSerif</option>
<option value="serif">Serif</option>
<option value="verdana">Verdana</option>
</select>
<select name="fsize" tabindex="10">
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14" selected="selected">14</option>
<option value="15">15</option>
<option value="16">16</option>
</select>
</fieldset>
<fieldset id="pt6">
<label for="showpart"><input type="checkbox" id="showpart" name="showpart" tabindex="6"/>Show Parts</label>
<label for="showquit"><input type="checkbox" id="showquit" name="showquit" tabindex="8"/>Show Quits</label>
</fieldset>
<fieldset id="pt7">
<label for="notified">Notify me if any of the following nicks login</label>
<input type="text" id="nnick1" tabindex="11" />
<input type="text" id="nnick1" tabindex="12" />
<input type="text" id="nnick3" tabindex="13" />
<input type="text" id="nnick4" tabindex="14" />
<input type="text" id="nnick5" tabindex="15" />
</fieldset>
<div id="copyright">All webpage content Copyright &copy 2010-2013, Perez Computer Services except where noted.</div>
</form>



</body>
</html>
[/ICODE]
And the javascript file:
[ICODE]
alert("Javascript is loaded")
function send() {
if (document.theform.nick.value == null || document.theform.nick.value == "JavaLoser") {
}
if (document.theform.userid.value == null || document.theform.userid.value == "" || document.theform.userid.value == "Please Type A User ID") {
alert('You must put in a userid before u can enter')
return false
}
var nick = document.theform.nick.value
var userid = document.theform.userid.value
var chan = document.theform.chan.value
var showtime = document.theform.showtime.value
var showjoin = document.theform.showjoin.value
var showpart = document.theform.showpart.value
var showquit = document.theform.showquit.value
var commandnumber = 1
win=window.open("","IRC Java Login by Zippy[D]","resizable=yes")
win.document.write('<html><head><title>Java By Zippy[D]</title></head>')
win.document.write('<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#000000">')
win.document.write('<applet code=IRCApplet.class archive="irc.jar" width="100%" height="100%">')
win.document.write('<param name="nick" value="'+nick+'">')
win.document.write('<param name="name" value="IRC/Java By Zippy[D]">')
win.document.write('<param name="host" value="irc.sweetoasistochat.com">')
win.document.write('<param name="port" value="6667">')
win.document.write('<param name="gui" value="pixx">')
win.document.write('<param name="quitmessage" value="I was using pjIRC">')
win.document.write('<param name="userid" value="'+sex+'">')
win.document.write('<param name="style:sourcecolorrule1" value="all all 0=ffffff 1=000000 2=00009a 3=009000 4=ff0000 5=9a0000 6=9f009f 7=ff7f00 8=ffff00 9=00ff00 10=00908f 11=00ffff 12=0000ff 13=ff00ff 14=7f7f7f 15=cfd0cf">')
win.document.write('<param name="style:bitmapsmileys" value="true">')
win.document.write('<param name="style:smiley1" value=":) img/sourire.gif">')
win.document.write('<param name="style:smiley2" value=":-) img/sourire.gif">')
win.document.write('<param name="style:smiley3" value=":-D img/content.gif">')
win.document.write('<param name="style:smiley4" value=":D img/content.gif">')
win.document.write('<param name="style:smiley5" value=":-d img/content.gif">')
win.document.write('<param name="style:smiley6" value=":d img/content.gif">')
win.document.write('<param name="style:smiley7" value=":-P img/langue.gif">')
win.document.write('<param name="style:smiley8" value=":p img/langue.gif">')
win.document.write('<param name="style:smiley9" value=":-p img/langue.gif">')
win.document.write('<param name="style:smiley10" value=":p img/langue.gif">')
win.document.write('<param name="style:smiley11" value=";-) img/clin-oeuil.gif">')
win.document.write('<param name="style:smiley12" value=";) img/clin-oeuil.gif">')
win.document.write('<param name="style:smiley13" value=";-P img/clin-oeuil-langue.gif">')
win.document.write('<param name="style:smiley14" value="; img/clin-oeuil-langue.gif">')
win.document.write('<param name="style:smiley15" value=";-p img/clin-oeuil-langue.gif">')
win.document.write('<param name="style:smiley16" value=";p img/clin-oeuil-langue.gif">')
win.document.write('<param name="style:smiley17" value="(H) img/cool.gif">')
win.document.write('<param name="style:smiley18" value="(h) img/cool.gif">')
win.document.write('<param name="style:smiley19" value="(A) img/ange.gif">')
win.document.write('<param name="style:smiley20" value="(a) img/ange.gif">')
win.document.write('<param name="style:smiley21" value="(6) img/disable.gif">')
win.document.write('<param name="style:smiley22" value=":-O img/OH-2.gif">')
win.document.write('<param name="style:smiley23" value=":O img/OH-2.gif">')
win.document.write('<param name="style:smiley24" value=":-o img/OH-2.gif">')
win.document.write('<param name="style:smiley25" value=":o img/OH-2.gif">')
win.document.write('<param name="style:smiley26" value=":-| img/mecontent.gif">')
win.document.write('<param name="style:smiley27" value=":| img/mecontent.gif">')
win.document.write('<param name="style:smiley28" value=":-@ img/enerve2.gif">')
win.document.write('<param name="style:smiley29" value=":@ img/enerve2.gif">')
win.document.write('<param name="style:smiley30" value=":-S img/roll-eyes.gif">')
win.document.write('<param name="style:smiley31" value=":S img/roll-eyes.gif">')
win.document.write('<param name="style:smiley32" value=":-s img/roll-eyes.gif">')
win.document.write('<param name="style:smiley33" value=":s img/roll-eyes.gif">')
win.document.write('<param name="style:smiley34" value=":-( img/triste.gif">')
win.document.write('<param name="style:smiley35" value=":( img/triste.gif">')
win.document.write('<param name="style:smiley36" value=":'+"'"+'( img/pleure.gif">')
win.document.write('<param name="style:smiley37" value=":'+"'"+'-( img/pleure.gif">')
win.document.write('<param name="style:smiley38" value="(GRR) img/argh.gif">')
win.document.write('<param name="style:smiley39" value="(grr) img/argh.gif">')
win.document.write('<param name="style:smiley40" value=":$ img/rouge.gif">')
win.document.write('<param name="style:smiley41" value=":-$ img/rouge.gif">')
win.document.write('<param name="style:smiley42" value="(K) img/kiss.gif">')
win.document.write('<param name="style:smiley43" value="(k) img/kiss.gif">')
win.document.write('<param name="style:smiley44" value="(F) img/flower.gif">')
win.document.write('<param name="style:smiley45" value="(f) img/flower.gif">')
win.document.write('<param name="style:smiley46" value="(L) img/heart.gif">')
win.document.write('<param name="style:smiley47" value="(l) img/heart.gif">')
win.document.write('<param name="style:smiley48" value="(U) img/b-heart.gif">')
win.document.write('<param name="style:smiley49" value="(u) img/b-heart.gif">')
win.document.write('<param name="style:smiley50" value="(:L) img/love.gif">')
win.document.write('<param name="style:smiley51" value="(:l) img/love.gif">')
win.document.write('<param name="style:smiley52" value="(B) img/beer.gif">')
win.document.write('<param name="style:smiley53" value="(b) img/beer.gif">')
win.document.write('<param name="style:smiley54" value="(D) img/drink.gif">')
win.document.write('<param name="style:smiley55" value="(d) img/drink.gif">')
win.document.write('<param name="style:smiley56" value="(CI) img/cig.gif">')
win.document.write('<param name="style:smiley57" value="(ci) img/cig.gif">')
win.document.write('<param name="style:smiley58" value="(Z) img/male.gif">')
win.document.write('<param name="style:smiley59" value="(z) img/male.gif">')
win.document.write('<param name="style:smiley60" value="(X) img/fem.gif">')
win.document.write('<param name="style:smiley61" value="(x) img/fem.gif">')
win.document.write('<param name="style:smiley62" value="(S) img/night.gif">')
win.document.write('<param name="style:smiley63" value="(s) img/night.gif">')
win.document.write('<param name="style:smiley64" value="(ZZ) img/sleep.gif">')
win.document.write('<param name="style:smiley65" value="(zz) img/sleep.gif">')
win.document.write('<param name="style:smiley66" value="(*) img/star.gif">')
win.document.write('<param name="style:smiley67" value="(Y) img/thumb-up.gif">')
win.document.write('<param name="style:smiley68" value="(y) img/thumb-up.gif">')
win.document.write('<param name="style:smiley69" value="(N) img/thumb-down.gif">')
win.document.write('<param name="style:smiley70" value="(n) img/thumb-down.gif">')
win.document.write('<param name="style:smiley71" value="(G) img/present.gif">')
win.document.write('<param name="style:smiley72" value="(g) img/present.gif">')
win.document.write('<param name="highlight" value="true">')
win.document.write('<param name="pixx:helppage" value="http://www.pjirc.com">')
win.document.write('<param name="pixx:highlight" value="true">')
win.document.write('<param name="pixx:highlightnick" value="true">')
win.document.write('<param name="pixx:highlightcolor" value="11">')
win.document.write('<param name="pixx:showconnect" value="true">')
win.document.write('<param name="pixx:showabout" value="false">')
if (document.theform.showtime.checked == "true") {
win.document.write('<param name="pixx:timestamp" value="true">')
}
else {
win.document.write('<param name="pixx:timestamp" value="false">')
}
if (document.theform.showjoin.checked == "true") {
win.document.write('<param name="pixx:showchannelnickjoin" value="true">')
else {
win.document.write('<param name="pixx:showchannelnickjoin" value="false">')
}
if (document.theform.showpart.checked == "true") {
win.document.write('<param name="pixx:showchannelnickpart" value="true">')
}
else
{
win.document.write('<param name="pixx:showchannelnickpart" value="false">')
}
if (document.theform.showquit.checked == "true") {
win.document.write('<param name="pixx:showchannelnickquit" value="true">')
}
else
{
win.document.write('<param name="pixx:showchannelnickquit" value="false">')
}
win.document.write('<param name="pixx:showhelp" value="true">')
win.document.write('<param name="pixx:nickfield" value="true">')
win.document.write('<param name="pixx:styleselector" value="true">')
win.document.write('<param name="pixx:setfontonstyle" value="true">')
win.document.write('<param name="pixx:color0" value="000000">')
win.document.write('<param name="pixx:color1" value="FFFFFF">')
win.document.write('<param name="pixx:color5" value="000000">')
win.document.write('<param name="pixx:color6" value="000000">')
win.document.write('<param name="pixx:color8" value="FF0000">')
win.document.write('<param name="pixx:color10" value="CC0000">')
win.document.write('<param name="pixx:color11" value="008800">')
win.document.write('<param name="pixx:color12" value="0044FF">')
if (document.theform.passwd.value != null && document.theform.passwd.value != "") {
win.document.write('<param name="command'+commandnumber+'" value="IDENTIFY '+document.theform.passwd.value+'">')
commandnumber += 1
}
if (document.login.nnick1.value != null && document.theform.nnick1.value != "") {
win.document.write('<param name="command'+commandnumber+'" value="WATCH +'+document.theform.nnick1.value+'">')
commandnumber += 1
}
if (document.theform.nnick2.value != null && document.theform.nnick2.value != "") {
win.document.write('<param name="command'+commandnumber+'" value="WATCH +'+document.theform.nnick2.value+'">')
commandnumber += 1
}
if (document.theform.nnick3.value != null && document.theform.nnick3.value != "") {
win.document.write('<param name="command'+commandnumber+'" value="WATCH +'+document.theform.nnick3.value+'">')
commandnumber += 1
}
if (document.theform.nnick4.value != null && document.theform.nnick4.value != "") {
win.document.write('<param name="command'+commandnumber+'" value="WATCH +'+document.theform.nnick4.value+'">')
commandnumber += 1
}
if (document.theform.nnick5.value != null && document.theform.nnick5.value != "") {
win.document.write('<param name="command'+commandnumber+'" value="WATCH +'+document.theform.nnick5.value+'">')
commandnumber += 1
}
if (chan != null && chan != "" && chan != "none" && chan != "None") {
win.document.write('<param name="command'+commandnumber+'" value="JOIN '+chan+'">')
commandnumber += 1
}
if (chan == null || chan == "" || chan == "none" || chan == "None") {
win.document.write('<param name="command'+commandnumber+'" value="LIST">')
commandnumber += 1
}
win.document.write('<param name="style:sourcefontrule1" value="all all '+document.theform.fname.value+' '+document.theform.fsize.value+'">')
win.document.write('</applet>')
win.document.write('</body>')
win.document.write('</html>')
win.document.close()
alert("Javascript is running")
return true
}

I hope this helps.

Old Pedant
01-03-2012, 11:16 PM
Ummm...the code you posted there (in post #4) works perfectly.

It doesn't do anything useful, of course, but it works correctly.

So it obviously isn't demonstrating your problem.

zipster1967
01-04-2012, 12:32 AM
Well my last post didn't seem to get there so I am trying again.
Here is the full html page I am working with.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="keywords" content="Javascript login form for IRC using PJirc" />
<meta name="author" content="author name goes here" />
<title>Enchatment Java Login</title>
<!--[if IE]>
<style type="text/css">
#theform #pt4 {
padding: 2em 1em 1em 1em;
}
</style>
<![endif]-->
<link rel="stylesheet" type="text/css" href="IRCloginform.css" /></style>
<script type="text/javascript" src="ircchat.js">
</script>
</head>
<body>
<h1 class="title">Enchatment Chat Home</h1>
<h2 class="subtitle">Chat Client (May take up to a minute to load)</h2>
<h2 class="subtitle2">NOTE: If your Popup blocker is stopping Chat opening hold down Ctrl key while clicking Connect</h2>
<form id="theform" action="send(nick,passwd,userid,chan,showtime,showjoin,showpart,showquit,fname,fsize,nnick1,nnick2,nnick3,nn ick4,nnick5)" enctype="multipart/form-data" method="post">
<fieldset id="pt1">
<label for="nick">Nickname</label>
<input type="text" id="nick" tabindex="1" />
<label for="userid">Gender/Orientation</label>
<select name="userid" tabindex="3">
<option value="Male selected="selected"">Male</option>
<option value="Female">Female</option>
<option value="Bi-Male">Bi-Male</option>
<option value="Bi-Female">Bi-Female</option>
<option value="TS-Male">Transsexual Male</option>
<option value="TS-Female">Transsexual Female</option>
</select>
</fieldset>
<fieldset id="pt2">
<label for="password">Password</label>
<input type="password" id="passwd" tabindex="2" />
<label for="chan">Channel to join</label>
<select name="chan" tabindex="4">
<option value="#Sweetoasis" selected="selected">#Sweetoasis</option>
<option value="#Sweetoasis_Help">#Sweetoasis_Help</option>
<option value="#Sweetoasis_Radio">#Sweetoasis_Radio</option>
</select>
</fieldset>
<fieldset id="pt3">
<div id="buttoncontainer">
<button type="button" name="submit" value="submit" class="css3button" onclick="send(nick,passwd,userid,chan,showtime,showjoin,showpart,showquit,fname,fsize,nnick1,nnick2,nnick3,nn ick4,nnick5)">Connect</button>
</div>
</fieldset>
<fieldset id="pt4">
<h2 class="subtitle">Advanced Settings (Not Required)</h2>
</fieldset>
<fieldset id="pt5">
<label for="showtime"><input type="checkbox" id="showtime" name="showtime" tabindex="5"/>Show Time Stamps</label>
<label for="showjoin"><input type="checkbox" id="showjoin" name="showjoin" tabindex="7"/>Show Joins</label>
<label for="fname">Font Name/Size</ label>
<select name="fname" tabindex="9">
<option value="monospaced">Monospaced</option>
<option value="dialog">Dialog</option>
<option value="dialog Input">Monospaced</option>
<option value="sanserif">SanSerif</option>
<option value="serif">Serif</option>
<option value="verdana">Verdana</option>
</select>
<select name="fsize" tabindex="10">
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14" selected="selected">14</option>
<option value="15">15</option>
<option value="16">16</option>
</select>
</fieldset>
<fieldset id="pt6">
<label for="showpart"><input type="checkbox" id="showpart" name="showpart" tabindex="6"/>Show Parts</label>
<label for="showquit"><input type="checkbox" id="showquit" name="showquit" tabindex="8"/>Show Quits</label>
</fieldset>
<fieldset id="pt7">
<label for="notified">Notify me if any of the following nicks login</label>
<input type="text" id="nnick1" tabindex="11" />
<input type="text" id="nnick1" tabindex="12" />
<input type="text" id="nnick3" tabindex="13" />
<input type="text" id="nnick4" tabindex="14" />
<input type="text" id="nnick5" tabindex="15" />
</fieldset>
<fieldset id="pt8">
<ul>
<li class="whitebold">We hope your visit here is rewarding as you make friends. </li>
<li class="whitebold">To promote an enjoyable experience, please follow these simple rules. </li>
<li class="red">* No one UNDER age 18 is allowed on this site. Period. By law, you are NOT permitted to enter here. </li>
<li class="white">* NO Flooding or Spamming (advertising) of any kind.</li>
<li class="white">* No Pedophilia, you will be reported.</li>
</ul>
</fieldset>
<div id="copyright">All web page content Copyright &copy 2010-2013, Perez Computer Services.</div>
</form>
</body>
</html>


This is the javascript file that is loaded externally


alert("Javascript is loaded")
function send() {
if (document.theform.nick.value == null || document.theform.nick.value == "JavaLoser") {
}
if (document.theform.userid.value == null || document.theform.userid.value == "" || document.theform.userid.value == "Please Type A User ID") {
alert('You must put in a userid before u can enter')
return false
}
var nick = document.theform.nick.value
var userid = document.theform.userid.value
var chan = document.theform.chan.value
var showtime = document.theform.showtime.value
var showjoin = document.theform.showjoin.value
var showpart = document.theform.showpart.value
var showquit = document.theform.showquit.value
var commandnumber = 1
alert("chan="+chan+" showtime="+showtime+" showjoin="+showjoin+" showpart="+showpart+" showquit="+showquit")
win=window.open("","IRC Java Login by Zippy[D]","resizable=yes")
win.document.write('<html><head><title>Java By Zippy[D]</title></head>')
win.document.write('<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#000000">')
win.document.write('<applet code=IRCApplet.class archive="irc.jar" width="100%" height="100%">')
win.document.write('<param name="nick" value="'+nick+'">')
win.document.write('<param name="name" value="IRC/Java By Zippy[D]">')
win.document.write('<param name="host" value="irc.sweetoasistochat.com">')
win.document.write('<param name="port" value="6667">')
win.document.write('<param name="gui" value="pixx">')
win.document.write('<param name="quitmessage" value="I was using pjIRC">')
win.document.write('<param name="userid" value="'+sex+'">')
win.document.write('<param name="style:sourcecolorrule1" value="all all 0=ffffff 1=000000 2=00009a 3=009000 4=ff0000 5=9a0000 6=9f009f 7=ff7f00 8=ffff00 9=00ff00 10=00908f 11=00ffff 12=0000ff 13=ff00ff 14=7f7f7f 15=cfd0cf">')
win.document.write('<param name="style:bitmapsmileys" value="true">')
win.document.write('<param name="style:smiley1" value=":) img/sourire.gif">')
win.document.write('<param name="style:smiley2" value=":-) img/sourire.gif">')
win.document.write('<param name="style:smiley3" value=":-D img/content.gif">')
win.document.write('<param name="style:smiley4" value=":D img/content.gif">')
win.document.write('<param name="style:smiley5" value=":-d img/content.gif">')
win.document.write('<param name="style:smiley6" value=":d img/content.gif">')
win.document.write('<param name="style:smiley7" value=":-P img/langue.gif">')
win.document.write('<param name="style:smiley8" value=":p img/langue.gif">')
win.document.write('<param name="style:smiley9" value=":-p img/langue.gif">')
win.document.write('<param name="style:smiley10" value=":p img/langue.gif">')
win.document.write('<param name="style:smiley11" value=";-) img/clin-oeuil.gif">')
win.document.write('<param name="style:smiley12" value=";) img/clin-oeuil.gif">')
win.document.write('<param name="style:smiley13" value=";-P img/clin-oeuil-langue.gif">')
win.document.write('<param name="style:smiley14" value="; img/clin-oeuil-langue.gif">')
win.document.write('<param name="style:smiley15" value=";-p img/clin-oeuil-langue.gif">')
win.document.write('<param name="style:smiley16" value=";p img/clin-oeuil-langue.gif">')
win.document.write('<param name="style:smiley17" value="(H) img/cool.gif">')
win.document.write('<param name="style:smiley18" value="(h) img/cool.gif">')
win.document.write('<param name="style:smiley19" value="(A) img/ange.gif">')
win.document.write('<param name="style:smiley20" value="(a) img/ange.gif">')
win.document.write('<param name="style:smiley21" value="(6) img/disable.gif">')
win.document.write('<param name="style:smiley22" value=":-O img/OH-2.gif">')
win.document.write('<param name="style:smiley23" value=":O img/OH-2.gif">')
win.document.write('<param name="style:smiley24" value=":-o img/OH-2.gif">')
win.document.write('<param name="style:smiley25" value=":o img/OH-2.gif">')
win.document.write('<param name="style:smiley26" value=":-| img/mecontent.gif">')
win.document.write('<param name="style:smiley27" value=":| img/mecontent.gif">')
win.document.write('<param name="style:smiley28" value=":-@ img/enerve2.gif">')
win.document.write('<param name="style:smiley29" value=":@ img/enerve2.gif">')
win.document.write('<param name="style:smiley30" value=":-S img/roll-eyes.gif">')
win.document.write('<param name="style:smiley31" value=":S img/roll-eyes.gif">')
win.document.write('<param name="style:smiley32" value=":-s img/roll-eyes.gif">')
win.document.write('<param name="style:smiley33" value=":s img/roll-eyes.gif">')
win.document.write('<param name="style:smiley34" value=":-( img/triste.gif">')
win.document.write('<param name="style:smiley35" value=":( img/triste.gif">')
win.document.write('<param name="style:smiley36" value=":'+"'"+'( img/pleure.gif">')
win.document.write('<param name="style:smiley37" value=":'+"'"+'-( img/pleure.gif">')
win.document.write('<param name="style:smiley38" value="(GRR) img/argh.gif">')
win.document.write('<param name="style:smiley39" value="(grr) img/argh.gif">')
win.document.write('<param name="style:smiley40" value=":$ img/rouge.gif">')
win.document.write('<param name="style:smiley41" value=":-$ img/rouge.gif">')
win.document.write('<param name="style:smiley42" value="(K) img/kiss.gif">')
win.document.write('<param name="style:smiley43" value="(k) img/kiss.gif">')
win.document.write('<param name="style:smiley44" value="(F) img/flower.gif">')
win.document.write('<param name="style:smiley45" value="(f) img/flower.gif">')
win.document.write('<param name="style:smiley46" value="(L) img/heart.gif">')
win.document.write('<param name="style:smiley47" value="(l) img/heart.gif">')
win.document.write('<param name="style:smiley48" value="(U) img/b-heart.gif">')
win.document.write('<param name="style:smiley49" value="(u) img/b-heart.gif">')
win.document.write('<param name="style:smiley50" value="(:L) img/love.gif">')
win.document.write('<param name="style:smiley51" value="(:l) img/love.gif">')
win.document.write('<param name="style:smiley52" value="(B) img/beer.gif">')
win.document.write('<param name="style:smiley53" value="(b) img/beer.gif">')
win.document.write('<param name="style:smiley54" value="(D) img/drink.gif">')
win.document.write('<param name="style:smiley55" value="(d) img/drink.gif">')
win.document.write('<param name="style:smiley56" value="(CI) img/cig.gif">')
win.document.write('<param name="style:smiley57" value="(ci) img/cig.gif">')
win.document.write('<param name="style:smiley58" value="(Z) img/male.gif">')
win.document.write('<param name="style:smiley59" value="(z) img/male.gif">')
win.document.write('<param name="style:smiley60" value="(X) img/fem.gif">')
win.document.write('<param name="style:smiley61" value="(x) img/fem.gif">')
win.document.write('<param name="style:smiley62" value="(S) img/night.gif">')
win.document.write('<param name="style:smiley63" value="(s) img/night.gif">')
win.document.write('<param name="style:smiley64" value="(ZZ) img/sleep.gif">')
win.document.write('<param name="style:smiley65" value="(zz) img/sleep.gif">')
win.document.write('<param name="style:smiley66" value="(*) img/star.gif">')
win.document.write('<param name="style:smiley67" value="(Y) img/thumb-up.gif">')
win.document.write('<param name="style:smiley68" value="(y) img/thumb-up.gif">')
win.document.write('<param name="style:smiley69" value="(N) img/thumb-down.gif">')
win.document.write('<param name="style:smiley70" value="(n) img/thumb-down.gif">')
win.document.write('<param name="style:smiley71" value="(G) img/present.gif">')
win.document.write('<param name="style:smiley72" value="(g) img/present.gif">')
win.document.write('<param name="highlight" value="true">')
win.document.write('<param name="pixx:helppage" value="http://www.pjirc.com">')
win.document.write('<param name="pixx:highlight" value="true">')
win.document.write('<param name="pixx:highlightnick" value="true">')
win.document.write('<param name="pixx:highlightcolor" value="11">')
win.document.write('<param name="pixx:showconnect" value="true">')
win.document.write('<param name="pixx:showabout" value="false">')
if (document.theform.showtime.checked == "true") {
win.document.write('<param name="pixx:timestamp" value="true">')
}
else {
win.document.write('<param name="pixx:timestamp" value="false">')
}
if (document.theform.showjoin.checked == "true") {
win.document.write('<param name="pixx:showchannelnickjoin" value="true">')
else {
win.document.write('<param name="pixx:showchannelnickjoin" value="false">')
}
if (document.theform.showpart.checked == "true") {
win.document.write('<param name="pixx:showchannelnickpart" value="true">')
}
else
{
win.document.write('<param name="pixx:showchannelnickpart" value="false">')
}
if (document.theform.showquit.checked == "true") {
win.document.write('<param name="pixx:showchannelnickquit" value="true">')
}
else
{
win.document.write('<param name="pixx:showchannelnickquit" value="false">')
}
win.document.write('<param name="pixx:showhelp" value="true">')
win.document.write('<param name="pixx:nickfield" value="true">')
win.document.write('<param name="pixx:styleselector" value="true">')
win.document.write('<param name="pixx:setfontonstyle" value="true">')
win.document.write('<param name="pixx:color0" value="000000">')
win.document.write('<param name="pixx:color1" value="FFFFFF">')
win.document.write('<param name="pixx:color5" value="000000">')
win.document.write('<param name="pixx:color6" value="000000">')
win.document.write('<param name="pixx:color8" value="FF0000">')
win.document.write('<param name="pixx:color10" value="CC0000">')
win.document.write('<param name="pixx:color11" value="008800">')
win.document.write('<param name="pixx:color12" value="0044FF">')
if (document.theform.passwd.value != null && document.theform.passwd.value != "") {
win.document.write('<param name="command'+commandnumber+'" value="IDENTIFY '+document.theform.passwd.value+'">')
commandnumber += 1
}
if (document.login.nnick1.value != null && document.theform.nnick1.value != "") {
win.document.write('<param name="command'+commandnumber+'" value="WATCH +'+document.theform.nnick1.value+'">')
commandnumber += 1
}
if (document.theform.nnick2.value != null && document.theform.nnick2.value != "") {
win.document.write('<param name="command'+commandnumber+'" value="WATCH +'+document.theform.nnick2.value+'">')
commandnumber += 1
}
if (document.theform.nnick3.value != null && document.theform.nnick3.value != "") {
win.document.write('<param name="command'+commandnumber+'" value="WATCH +'+document.theform.nnick3.value+'">')
commandnumber += 1
}
if (document.theform.nnick4.value != null && document.theform.nnick4.value != "") {
win.document.write('<param name="command'+commandnumber+'" value="WATCH +'+document.theform.nnick4.value+'">')
commandnumber += 1
}
if (document.theform.nnick5.value != null && document.theform.nnick5.value != "") {
win.document.write('<param name="command'+commandnumber+'" value="WATCH +'+document.theform.nnick5.value+'">')
commandnumber += 1
}
if (chan != null && chan != "" && chan != "none" && chan != "None") {
win.document.write('<param name="command'+commandnumber+'" value="JOIN '+chan+'">')
commandnumber += 1
}
if (chan == null || chan == "" || chan == "none" || chan == "None") {
win.document.write('<param name="command'+commandnumber+'" value="LIST">')
commandnumber += 1
}
win.document.write('<param name="style:sourcefontrule1" value="all all '+document.theform.fname.value+' '+document.theform.fsize.value+'">')
win.document.write('</applet>')
win.document.write('</body>')
win.document.write('</html>')
win.document.close()
alert("Javascript is running")
return true
}

I didnt include the CSS file as I dont think that is part of my problem as the page looks good when it loads.
But when you click on the Connect button nothing hapens. The alert box doesn't even popup.

Old Pedant
01-04-2012, 05:37 AM
You've got two or three syntax errors in the javascript.

Use a debugger to find them. They are easy to find.

But then when I click on the connect button, it says "nnick2 is undefined".

And indeed it is not. You have nnick1 twice, instead.

BUt there are various other problems with the code.

Just for starters, you call the send( ) expecting to pass a mess of variables but *none* of those variables are actually defined. As it turns out, though, your send() function doesn't even use all those arguments. You should be just calling send( ) with no arguments.

Time to learn how to use a javascript debugger.

zipster1967
01-04-2012, 07:07 AM
Okay where do I find a debugger? I am very new to javascript. I studies=d it back in school a few years ago but the book I have is really old and just covers the basics so Where do I locate a debugger?

_Aerospace_Eng_
01-04-2012, 03:13 PM
Well that depends. What browser are you using? IE8+, Firefox, and Chrome all have some type of developer tools. Firefox needs plugins but they have a pretty decent javascript console.

zipster1967
01-08-2012, 10:23 PM
Well I fixed the syntax errors I found using firebug and the script s function runs but there are still no variables being passed to the script. I want the values entered on the form to be passed to the javascript file so how do I go about getting those values into the javascript file values. I thought the document.theform.field.value would get the value from the form but this doesn;t seem to be the case. What am I doing wrong here?

_Aerospace_Eng_
01-09-2012, 04:47 AM
Post your updated code

zipster1967
01-09-2012, 05:24 AM
New HTML file


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="keywords" content="Javascript login form for IRC using PJirc" />
<meta name="author" content="Trent Perez: trentjp@perezcomputer.com" />
<title>Enchatment Java Login</title>
<!--[if IE]>
<style type="text/css">
#theform #pt4 {
padding: 2em 1em 1em 1em;
}
</style>
<![endif]-->
<link rel="stylesheet" type="text/css" href="IRCloginform.css" /></style>
<script type="text/javascript" src="ircchat.js">
</script>
</head>
<body>
<h1 class="title">Enchatment Chat Home</h1>
<h2 class="subtitle">Chat Client (May take up to a minute to load)</h2>
<h2 class="subtitle2">NOTE: If your Popup blocker is stopping Chat opening hold down Ctrl key while clicking Connect</h2>
<form id="theform" action="javascript:send(nick,passwd,userid,chan,showtime,showjoin,showpart,showquit,fname,fsize,nnick1,nnick 2,nnick3,nnick4,nnick5)" enctype="multipart/form-data" method="post">
<fieldset id="pt1">
<label for="nick">Nickname</label>
<input type="text" id="nick" tabindex="1" />
<label for="userid">Gender/Orientation</label>
<select name="userid" tabindex="3">
<option value="Male selected="selected"">Male</option>
<option value="Female">Female</option>
<option value="Bi-Male">Bi-Male</option>
<option value="Bi-Female">Bi-Female</option>
<option value="TS-Male">Transsexual Male</option>
<option value="TS-Female">Transsexual Female</option>
</select>
</fieldset>
<fieldset id="pt2">
<label for="password">Password</label>
<input type="password" id="passwd" tabindex="2" />
<label for="chan">Channel to join</label>
<select name="chan" tabindex="4">
<option value="#Sweetoasis" selected="selected">#Sweetoasis</option>
<option value="#Sweetoasis_Help">#Sweetoasis_Help</option>
<option value="#Sweetoasis_Radio">#Sweetoasis_Radio</option>
</select>
</fieldset>
<fieldset id="pt3">
<div id="buttoncontainer">
<button type="button" name="submit" value="submit" class="css3button" onclick="send(nick,passwd,userid,chan,showtime,showjoin,showpart,showquit,fname,fsize,nnick1,nnick2,nnick3,nn ick4,nnick5)">Connect</button>
</div>
</fieldset>
<fieldset id="pt4">
<h2 class="subtitle">Advanced Settings (Not Required)</h2>
</fieldset>
<fieldset id="pt5">
<label for="showtime"><input type="checkbox" id="showtime" name="showtime" tabindex="5"/>Show Time Stamps</label>
<label for="showjoin"><input type="checkbox" id="showjoin" name="showjoin" tabindex="7"/>Show Joins</label>
<label for="fname">Font Name/Size</ label>
<select name="fname" tabindex="9">
<option value="monospaced">Monospaced</option>
<option value="dialog">Dialog</option>
<option value="dialog Input">Monospaced</option>
<option value="sanserif">SanSerif</option>
<option value="serif">Serif</option>
<option value="verdana">Verdana</option>
</select>
<select name="fsize" tabindex="10">
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14" selected="selected">14</option>
<option value="15">15</option>
<option value="16">16</option>
</select>
</fieldset>
<fieldset id="pt6">
<label for="showpart"><input type="checkbox" id="showpart" name="showpart" tabindex="6"/>Show Parts</label>
<label for="showquit"><input type="checkbox" id="showquit" name="showquit" tabindex="8"/>Show Quits</label>
</fieldset>
<fieldset id="pt7">
<label for="notified">Notify me if any of the following nicks login</label>
<input type="text" id="nnick1" tabindex="11" />
<input type="text" id="nnick2" tabindex="12" />
<input type="text" id="nnick3" tabindex="13" />
<input type="text" id="nnick4" tabindex="14" />
<input type="text" id="nnick5" tabindex="15" />
</fieldset>
<fieldset id="pt8">
<ul>
<li class="whitebold">We hope your visit here is rewarding as you make friends. </li>
<li class="whitebold">To promote an enjoyable experience, please follow these simple rules. </li>
<li class="red">* No one UNDER age 18 is allowed on this site. Period. By law, you are NOT permitted to enter here. </li>
<li class="white">* NO Flooding or Spamming (advertising) of any kind.</li>
<li class="white">* No Pedophilia, you will be reported.</li>
</ul>
</fieldset>
<div id="copyright">All web page content Copyright &copy 2010-2013, Perez Computer Services.</div>
</form>
</body>
</html>

And the new javascript file


var nick = "GuestUser"
var userid = "Male"
var chan = "#sweetoasis"
var showtime = "true"
var showjoin = "true"
var showpart = "true"
var showquit = "true"
var nick = document.theform.nick.value
var userid = document.theform.userid.value
var chan = document.theform.chan.value
var showtime = document.theform.showtime.value
var showjoin = document.theform.showjoin.value
var showpart = document.theform.showpart.value
var showquit = document.theform.showquit.value
function send(nick,passwd,userid,chan,showtime,showjoin,showpart,showquit,fname,fsize,nnick1,nnick2,nnick3,nn ick4,nnick5) {
if (document.theform.nick.value == null || document.theform.nick.value == "JavaLoser") {
}
if (document.theform.userid.value == null || document.theform.userid.value == "" || document.theform.userid.value == "Please Type A User ID") {
alert('You must put in a userid before u can enter')
return false
}
var nick = document.theform.nick.value
var userid = document.theform.userid.value
var chan = document.theform.chan.value
var showtime = document.theform.showtime.value
var showjoin = document.theform.showjoin.value
var showpart = document.theform.showpart.value
var showquit = document.theform.showquit.value
var commandnumber = 1
win=window.open("","IRC Java Login by Zippy[D]","resizable=yes")
win.document.write('<html><head><title>Java By Zippy[D]</title></head>')
win.document.write('<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#000000">')
win.document.write('<applet code=IRCApplet.class archive="irc.jar" width="100%" height="100%">')
win.document.write('<param name="nick" value="'+nick+'">')
win.document.write('<param name="name" value="IRC/Java By Zippy[D]">')
win.document.write('<param name="host" value="irc.sweetoasistochat.com">')
win.document.write('<param name="port" value="6667">')
win.document.write('<param name="gui" value="pixx">')
win.document.write('<param name="quitmessage" value="I was using pjIRC">')
win.document.write('<param name="userid" value="'+sex+'">')
win.document.write('<param name="style:sourcecolorrule1" value="all all 0=ffffff 1=000000 2=00009a 3=009000 4=ff0000 5=9a0000 6=9f009f 7=ff7f00 8=ffff00 9=00ff00 10=00908f 11=00ffff 12=0000ff 13=ff00ff 14=7f7f7f 15=cfd0cf">')
win.document.write('<param name="style:bitmapsmileys" value="true">')
win.document.write('<param name="style:smiley1" value=":) img/sourire.gif">')
win.document.write('<param name="style:smiley2" value=":-) img/sourire.gif">')
win.document.write('<param name="style:smiley3" value=":-D img/content.gif">')
win.document.write('<param name="style:smiley4" value=":D img/content.gif">')
win.document.write('<param name="style:smiley5" value=":-d img/content.gif">')
win.document.write('<param name="style:smiley6" value=":d img/content.gif">')
win.document.write('<param name="style:smiley7" value=":-P img/langue.gif">')
win.document.write('<param name="style:smiley8" value=":p img/langue.gif">')
win.document.write('<param name="style:smiley9" value=":-p img/langue.gif">')
win.document.write('<param name="style:smiley10" value=":p img/langue.gif">')
win.document.write('<param name="style:smiley11" value=";-) img/clin-oeuil.gif">')
win.document.write('<param name="style:smiley12" value=";) img/clin-oeuil.gif">')
win.document.write('<param name="style:smiley13" value=";-P img/clin-oeuil-langue.gif">')
win.document.write('<param name="style:smiley14" value="; img/clin-oeuil-langue.gif">')
win.document.write('<param name="style:smiley15" value=";-p img/clin-oeuil-langue.gif">')
win.document.write('<param name="style:smiley16" value=";p img/clin-oeuil-langue.gif">')
win.document.write('<param name="style:smiley17" value="(H) img/cool.gif">')
win.document.write('<param name="style:smiley18" value="(h) img/cool.gif">')
win.document.write('<param name="style:smiley19" value="(A) img/ange.gif">')
win.document.write('<param name="style:smiley20" value="(a) img/ange.gif">')
win.document.write('<param name="style:smiley21" value="(6) img/disable.gif">')
win.document.write('<param name="style:smiley22" value=":-O img/OH-2.gif">')
win.document.write('<param name="style:smiley23" value=":O img/OH-2.gif">')
win.document.write('<param name="style:smiley24" value=":-o img/OH-2.gif">')
win.document.write('<param name="style:smiley25" value=":o img/OH-2.gif">')
win.document.write('<param name="style:smiley26" value=":-| img/mecontent.gif">')
win.document.write('<param name="style:smiley27" value=":| img/mecontent.gif">')
win.document.write('<param name="style:smiley28" value=":-@ img/enerve2.gif">')
win.document.write('<param name="style:smiley29" value=":@ img/enerve2.gif">')
win.document.write('<param name="style:smiley30" value=":-S img/roll-eyes.gif">')
win.document.write('<param name="style:smiley31" value=":S img/roll-eyes.gif">')
win.document.write('<param name="style:smiley32" value=":-s img/roll-eyes.gif">')
win.document.write('<param name="style:smiley33" value=":s img/roll-eyes.gif">')
win.document.write('<param name="style:smiley34" value=":-( img/triste.gif">')
win.document.write('<param name="style:smiley35" value=":( img/triste.gif">')
win.document.write('<param name="style:smiley36" value=":'+"'"+'( img/pleure.gif">')
win.document.write('<param name="style:smiley37" value=":'+"'"+'-( img/pleure.gif">')
win.document.write('<param name="style:smiley38" value="(GRR) img/argh.gif">')
win.document.write('<param name="style:smiley39" value="(grr) img/argh.gif">')
win.document.write('<param name="style:smiley40" value=":$ img/rouge.gif">')
win.document.write('<param name="style:smiley41" value=":-$ img/rouge.gif">')
win.document.write('<param name="style:smiley42" value="(K) img/kiss.gif">')
win.document.write('<param name="style:smiley43" value="(k) img/kiss.gif">')
win.document.write('<param name="style:smiley44" value="(F) img/flower.gif">')
win.document.write('<param name="style:smiley45" value="(f) img/flower.gif">')
win.document.write('<param name="style:smiley46" value="(L) img/heart.gif">')
win.document.write('<param name="style:smiley47" value="(l) img/heart.gif">')
win.document.write('<param name="style:smiley48" value="(U) img/b-heart.gif">')
win.document.write('<param name="style:smiley49" value="(u) img/b-heart.gif">')
win.document.write('<param name="style:smiley50" value="(:L) img/love.gif">')
win.document.write('<param name="style:smiley51" value="(:l) img/love.gif">')
win.document.write('<param name="style:smiley52" value="(B) img/beer.gif">')
win.document.write('<param name="style:smiley53" value="(b) img/beer.gif">')
win.document.write('<param name="style:smiley54" value="(D) img/drink.gif">')
win.document.write('<param name="style:smiley55" value="(d) img/drink.gif">')
win.document.write('<param name="style:smiley56" value="(CI) img/cig.gif">')
win.document.write('<param name="style:smiley57" value="(ci) img/cig.gif">')
win.document.write('<param name="style:smiley58" value="(Z) img/male.gif">')
win.document.write('<param name="style:smiley59" value="(z) img/male.gif">')
win.document.write('<param name="style:smiley60" value="(X) img/fem.gif">')
win.document.write('<param name="style:smiley61" value="(x) img/fem.gif">')
win.document.write('<param name="style:smiley62" value="(S) img/night.gif">')
win.document.write('<param name="style:smiley63" value="(s) img/night.gif">')
win.document.write('<param name="style:smiley64" value="(ZZ) img/sleep.gif">')
win.document.write('<param name="style:smiley65" value="(zz) img/sleep.gif">')
win.document.write('<param name="style:smiley66" value="(*) img/star.gif">')
win.document.write('<param name="style:smiley67" value="(Y) img/thumb-up.gif">')
win.document.write('<param name="style:smiley68" value="(y) img/thumb-up.gif">')
win.document.write('<param name="style:smiley69" value="(N) img/thumb-down.gif">')
win.document.write('<param name="style:smiley70" value="(n) img/thumb-down.gif">')
win.document.write('<param name="style:smiley71" value="(G) img/present.gif">')
win.document.write('<param name="style:smiley72" value="(g) img/present.gif">')
win.document.write('<param name="highlight" value="true">')
win.document.write('<param name="pixx:helppage" value="http://www.pjirc.com">')
win.document.write('<param name="pixx:highlight" value="true">')
win.document.write('<param name="pixx:highlightnick" value="true">')
win.document.write('<param name="pixx:highlightcolor" value="11">')
win.document.write('<param name="pixx:showconnect" value="true">')
win.document.write('<param name="pixx:showabout" value="false">')
if (document.theform.showtime.checked == "true")
{
win.document.write('<param name="pixx:timestamp" value="true">')
}
else
{
win.document.write('<param name="pixx:timestamp" value="false">')
}
if (document.theform.showjoin.checked == "true")
{
win.document.write('<param name="pixx:showchannelnickjoin" value="true">')
}
else
{
win.document.write('<param name="pixx:showchannelnickjoin" value="false">')
}
if (document.theform.showpart.checked == "true")
{
win.document.write('<param name="pixx:showchannelnickpart" value="true">')
}
else
{
win.document.write('<param name="pixx:showchannelnickpart" value="false">')
}
if (document.theform.showquit.checked == "true")
{
win.document.write('<param name="pixx:showchannelnickquit" value="true">')
}
else
{
win.document.write('<param name="pixx:showchannelnickquit" value="false">')
}
win.document.write('<param name="pixx:showhelp" value="true">')
win.document.write('<param name="pixx:nickfield" value="true">')
win.document.write('<param name="pixx:styleselector" value="true">')
win.document.write('<param name="pixx:setfontonstyle" value="true">')
win.document.write('<param name="pixx:color0" value="000000">')
win.document.write('<param name="pixx:color1" value="FFFFFF">')
win.document.write('<param name="pixx:color5" value="000000">')
win.document.write('<param name="pixx:color6" value="000000">')
win.document.write('<param name="pixx:color8" value="FF0000">')
win.document.write('<param name="pixx:color10" value="CC0000">')
win.document.write('<param name="pixx:color11" value="008800">')
win.document.write('<param name="pixx:color12" value="0044FF">')
if (document.theform.passwd.value != null && document.theform.passwd.value != "")
{
win.document.write('<param name="command'+commandnumber+'" value="IDENTIFY '+document.theform.passwd.value+'">')
commandnumber += 1
}
if (document.login.nnick1.value != null && document.theform.nnick1.value != "")
{
win.document.write('<param name="command'+commandnumber+'" value="WATCH +'+document.theform.nnick1.value+'">')
commandnumber += 1
}
if (document.theform.nnick2.value != null && document.theform.nnick2.value != "")
{
win.document.write('<param name="command'+commandnumber+'" value="WATCH +'+document.theform.nnick2.value+'">')
commandnumber += 1
}
if (document.theform.nnick3.value != null && document.theform.nnick3.value != "")
{
win.document.write('<param name="command'+commandnumber+'" value="WATCH +'+document.theform.nnick3.value+'">')
commandnumber += 1
}
if (document.theform.nnick4.value != null && document.theform.nnick4.value != "")
{
win.document.write('<param name="command'+commandnumber+'" value="WATCH +'+document.theform.nnick4.value+'">')
commandnumber += 1
}
if (document.theform.nnick5.value != null && document.theform.nnick5.value != "")
{
win.document.write('<param name="command'+commandnumber+'" value="WATCH +'+document.theform.nnick5.value+'">')
commandnumber += 1
}
if (chan != null && chan != "" && chan != "none" && chan != "None")
{
win.document.write('<param name="command'+commandnumber+'" value="JOIN '+chan+'">')
commandnumber += 1
}
if (chan == null || chan == "" || chan == "none" || chan == "None")
{
win.document.write('<param name="command'+commandnumber+'" value="LIST">')
commandnumber += 1
}
win.document.write('<param name="style:sourcefontrule1" value="all all '+document.theform.fname.value+' '+document.theform.fsize.value+'">')
win.document.write('</applet>')
win.document.write('</body>')
win.document.write('</html>')
win.document.close()
alert("Javascript is running")
return true
}

From what I have read this is suppose to weork but I am getting confused with al the different methods that I have read about and would just like to find out how to get what I want accomplished. I know I am far from being a javascript expert but I need to get this to work any way possible.

xelawho
01-09-2012, 05:49 AM
var nick = document.theform.nick.value

"document.theform is undefined"
"sex is not defined"

are you sure you got firebug?

for the first one, try:

<form name="theform" action="javascript:send(nick,passwd,userid,chan,showtime,showjoin,showpart,showquit,fname,fsize,nnick1,nnick 2,nnick3,nnick4,nnick5)" enctype="multipart/form-data" method="post">

zipster1967
01-10-2012, 12:08 AM
I added form name="theform" but the function still won't run. firebug breakpoint occurs at the send function call and I can't move past it. I have not used firebug much for debugging javascript. As far as the undefined values how do i get the values from the webform into the javascript variables?

_Aerospace_Eng_
01-10-2012, 05:57 AM
Initialize them AFTER the page loads. You could stick them directly in the send function and remove the arguments then just call send().

zipster1967
01-15-2012, 07:54 AM
Initialize them? I am sorry but I am not sure what them you are referring to. Also where do I put the variable assignments (I am assuming that is how to initialize the "them" you are talking about) to have them initialize after the page loads? Also how do I include "them" in the function? Please explain it as if I know nothing about javascript structures because I am sure others looking for this solution will have that lack of knowledge and it would be best if the explanation was targeted towards them.

DaveyErwin
01-15-2012, 04:04 PM
Initialize them? I am sorry but I am not sure what them you are referring to. Also where do I put the variable assignments (I am assuming that is how to initialize the "them" you are talking about) to have them initialize after the page loads? Also how do I include "them" in the function? Please explain it as if I know nothing about javascript structures because I am sure others looking for this solution will have that lack of knowledge and it would be best if the explanation was targeted towards them.

This is a way to initialize after page loads ...


var nick = "GuestUser"
var userid = "Male"
var chan = "#sweetoasis"
var showtime = "true"
var showjoin = "true"
var showpart = "true"
var showquit = "true"

window.onload=function(){
nick = document.theform.nick.value
userid = document.theform.userid.value
chan = document.theform.chan.value
showtime = document.theform.showtime.value
showjoin = document.theform.showjoin.value
showpart = document.theform.showpart.value
showquit = document.theform.showquit.value
}

You have other problems here.

document.theform will not work
unless the form name is theform
so change id="theform" to
name="theform" in the form tag.

You seem to have ID , Sex , Gender and
Sexual Orientation confused.

While there are many
types of sex there are only two
genders.

zipster1967
01-17-2012, 08:00 AM
This is a way to initialize after page loads ...
You have other problems here.

document.theform will not work
unless the form name is theform
so change id="theform" to
name="theform" in the form tag.


<form id="theform" name="theform" action="javascript:send()" enctype="multipart/form-data" method="post">


You seem to have ID , Sex , Gender and
Sexual Orientation confused.

While there are many
types of sex there are only two
genders.

As far as I can tell the gender and sexual orientation is held in the userid field in the form. and that is all that is referenced in the javascript file and the form in the HTML file unless I missed a reference somewhere.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum