Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 05-05-2005, 12:44 PM   #1
Registered: Jan 2005
Distribution: slackware
Posts: 83

Rep: Reputation: 15
Thumbs up Javascript??

Why am i not able to get this to return the imput?
any help greatly appreciated.


P.S.Here is the file that im talking about

<title>Robots 4 Sale</title>
function calculate_total( bb)
document.write("Type: " + bb)

<body bgcolor="#708090">

<script language="JavaScript1.2">
if (document.all||document.getElementById)"url('bg.jpg') bottom right no-repeat fixed"

<center><marquee bgcolor=dodgerblue width=250 ><h1>ROBOTS!
<img src="images/1.jpg"><img src="1.jpg"><img src="1.jpg">
<font face="Batang">

Domo Arigato Mr. Roboto. <br>
How many times have you wanted to not clean up your room, or do anything at all?
Do you remember the last time you wished you had a bodyguard or a helper robot?
<br>Well now you dont have to!<br>

   <form name="joes"><br>
   <input type="radio" name="bb" value="generic">Generic Robot<br>
   <input type="radio" name="bb" value="helper">Helper Robot<br>
   <input type="radio" name="bb" value="bodyguard">Body Guard<br>
   <input type="radio" name="bb" value="killer">Killer Robot <br>
   <input type="submit" name="submit" value="submit" onclick="calculate_total(">


Last edited by swatward; 05-05-2005 at 06:49 PM.
Old 05-06-2005, 05:51 AM   #2
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714
Try to name your checkbox with an unique name, like bb1, bb2...

If you want to capture checkbox value, try :
global_type = "generic"; // default to generic
function update_type( type )
    global_type = type;
function calculate_total()
document.write("Type: " + global_type);
   <form name="joes"><br>
   <input type="radio" name="bb" value="generic" onclick="update_type(this.value)">Generic Robot<br>
   <input type="radio" name="bb" value="helper" onclick="update_type(this.value)">Helper Robot<br>
   <input type="radio" name="bb" value="bodyguard" onclick="update_type(this.value)">Body Guard<br>
   <input type="radio" name="bb" value="killer" onclick="update_type(this.value)">Killer Robot <br>
   <input type="submit" name="submit" value="submit" onclick="calculate_total();">

Last edited by keefaz; 05-06-2005 at 06:00 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
MythTV claims all my inputs are in use. None actually are Pcghost Linux - Software 2 03-24-2005 11:42 AM
javascript alerts with radio modules graziano1968 Programming 3 11-10-2004 04:14 AM
No Sound from Motherboard Inputs? braincandy99 Slackware 3 07-18-2004 07:22 AM
X-Net Radio! Internet Radio with an attitude! xnetradio General 1 01-11-2004 12:01 PM
getting info on video inputs Jo_Nak Programming 1 06-16-2003 04:40 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:21 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration