Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    New Coder
    Join Date
    Mar 2008
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Script doesn't seem to be running

    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,nnick4,nnick5)">Connect</button>
    I may be using the button wrong but I am new to javascript. Any suggestions would help.

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    3,020
    Thanks
    56
    Thanked 566 Times in 563 Posts
    hard to say without seeing the rest of your code.

    what does the error console say?

  • #3
    Regular Coder Amphiluke's Avatar
    Join Date
    Jul 2009
    Posts
    312
    Thanks
    3
    Thanked 89 Times in 89 Posts
    The first potential source of errors is that the button's name is set to "submit", which in fact makes programmatic form sending impossible.
    I am still learning English

  • #4
    Regular Coder
    Join Date
    Aug 2010
    Posts
    974
    Thanks
    19
    Thanked 212 Times in 210 Posts
    Code:
    <!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>

  • #5
    New Coder
    Join Date
    Mar 2008
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re error codes

    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
    Code:
    <!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,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,nnick4,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.
    Last edited by VIPStephan; 01-04-2012 at 03:04 AM.

  • #6
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,617
    Thanks
    80
    Thanked 4,635 Times in 4,597 Posts
    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.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #7
    New Coder
    Join Date
    Mar 2008
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Script function not running still

    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.
    Code:
    <!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,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,nnick4,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
    Code:
    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.

  • #8
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,617
    Thanks
    80
    Thanked 4,635 Times in 4,597 Posts
    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.
    Last edited by Old Pedant; 01-04-2012 at 05:41 AM.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #9
    New Coder
    Join Date
    Mar 2008
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript Debugger

    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?

  • #10
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #11
    New Coder
    Join Date
    Mar 2008
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  • #12
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Post your updated code
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #13
    New Coder
    Join Date
    Mar 2008
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    New HTML file
    Code:
    <!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,nnick2,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,nnick4,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
    Code:
    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,nnick4,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.

  • #14
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    3,020
    Thanks
    56
    Thanked 566 Times in 563 Posts
    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:
    Code:
    <form name="theform" action="javascript:send(nick,passwd,userid,chan,showtime,showjoin,showpart,showquit,fname,fsize,nnick1,nnick2,nnick3,nnick4,nnick5)" enctype="multipart/form-data" method="post">
    Last edited by xelawho; 01-09-2012 at 05:52 AM.

  • #15
    New Coder
    Join Date
    Mar 2008
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?
    Last edited by zipster1967; 01-10-2012 at 04:37 AM.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •