• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 303
  • Last Modified:

php mysql radio button issue

Hi All,
I have a mysql database that I am accessing via PHP.  I have code that gets category_column, category_type and category_category (name) from the category table.  It then gets all of the options that are assigned to a specific category and creates a table for the category and options.  It does this for each category and it's options.  It then checks the category_column and writes the category and its options (the category html table) to the left or right column of the master html table.  Every option is a checkbox.  This all works perfectly... but, now I need to use radio buttons for some categories.  I have got this working except that each radio button in a category has a different name, so you can select all of them, where I need to only select one per category.  I can change the name for the radio buttons to the same name per category, but this will messup the database input.  I am not sure if this can be handled with javascript or some other method.
here is my code:
[code]
<?
include("../connect.php");
$query_cat = mysql_query("SELECT * FROM category");

$i = 1;      

$leftcolumn ="";

$rightcolumn ="";

while($cat_row = mysql_fetch_object($query_cat)) {

$store = ($cat_row->category_column=="Left"?"leftcolumn":"rightcolumn");


      $query="SELECT options.* , vendor.vendor_company as vendor FROM options,vendor  WHERE options.options_vendor=vendor.vendor_id AND options.options_category = " . $cat_row-> category_id;
        
      $result=mysql_query($query);
        
        $$store .=  '<style type="text/css"><!--
.style2 {font-size: 12px; }
--></style>';

      $$store .= "<img src=\"../options/images/divide2.gif\"><br><br><span class=\"style2\"><b><font color=\"#333333\">".$cat_row->category_category."</font></b></span>";  
        
        
        
      $$store .= ' <table width="100%" border="0" cellpadding="0" cellspacing="0">';
     
     while($row = mysql_fetch_object($result)) {

 if ($cat_row->category_type == "radiobutton") { $display_type = "<input name=\"roptselect$i\" type=\"radio\" onclick=\"this.form.total.value=calculateTotal(this);\" value=\"$row->options_retail\"/> <input name=\"roptname$i\" type=\"hidden\" value=\"$row->options_name\" /> <input name=\"ropt$i\" type=\"hidden\" value=\"$row->options_retail\" /> <input name=\"dopt$i\" type=\"hidden\" value=\"$row->options_dealer\" /> <input name=\"copt$i\" type=\"hidden\" value=\"$row->options_cost\" />"; } else { $display_type = "<input name=\"roptselect$i\" type=\"checkbox\" onclick=\"this.form.total.value=calculateTotal(this);\" value=\"$row->options_retail\"/> <input name=\"roptname$i\" type=\"hidden\" value=\"$row->options_name\" /> <input name=\"ropt$i\" type=\"hidden\" value=\"$row->options_retail\" /> <input name=\"dopt$i\" type=\"hidden\" value=\"$row->options_dealer\" /> <input name=\"copt$i\" type=\"hidden\" value=\"$row->options_cost\" />"; }       
      
$iteration = 'optionid' . $i;
$standard = 'std' . $i;    
      
 if ($$standard == "1") { $printstandard = "<img src=\"../script/checked.gif\"> <input name=\"roptselect$i\" type=\"hidden\" value=\"$row->options_retail\" /> <input name=\"roptname$i\" type=\"hidden\" value=\"$row->options_name\" /> <input name=\"ropt$i\" type=\"hidden\" value=\"std\" /> <input name=\"dopt$i\" type=\"hidden\" value=\"std\" /> <input name=\"copt$i\" type=\"hidden\" value=\"std\" />"; } else { $printstandard = "$display_type"; }

 if ($$standard == "1") { $options_retail1 = 'std'; } else { $options_retail1 = '$' . $row->options_retail; }       
      
$$store .= '<tr><span class="style2">';

 if ($$iteration != "") { $$store .= "<td width=\"80%\" align=\"left\">$printstandard <a href=\"#\" onmouseover=\"Tip('$row->options_description<br><img src=\'../options/images/$row->options_image\' width=\'250\'>')\">$row->options_name</a></td><td width=\"20%\"align=\"right\"><font color=\"white\"><strong>$options_retail1</strong></font></td>"; }
 $$store .=      "</span></tr>";

       $i++;
      }      
      $$store .= "</table><br>";
}

mysql_close();
?>

</form>
<p>
  <?
++$i;
}
mysql_close();
?>
0
newbe101
Asked:
newbe101
  • 11
  • 8
1 Solution
 
newbe101Author Commented:
maybe tag each radio button with the category name then have some javascript look at the category name to handle the choices for that category???
0
 
VincentPugliaCommented:
I'm presuming you mean this line:

 if ($cat_row->category_type == "radiobutton") { $display_type = "<input name=\"roptselect$i\" type=\"radio\" onclick=\"this.form.total.value=calculateTotal(this);\" value=\"$row->options_retail\"/>

one option would be to assign \"roptselect$i\"  to the id attribute, and whatever you want to the name attribute.  you can then write a short script either in javascript or php to check the id for the 'real' name.

0
 
VincentPugliaCommented:
for example:

 if ($cat_row->category_type == "radiobutton") { $display_type = "<input name='group1' id=\"roptselect$i\" type=\"radio\" onclick=\"this.form.total.value=calculateTotal(this);\" value=\"$row->options_retail\"/>

while (document.formname.elements[i].name == 'group1')
{
   if (document.formname.elements[i].checked)
      group1Checked = document.formname.elements[i].id
}

0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
VincentPugliaCommented:
i hate this 'editor'  :(

you'd need to put the above in a loop, and increment the i var within the while loop

but what the hay it's not supposed to really work only be an example of what can be done
0
 
newbe101Author Commented:
Yes, that line.

how about if the name is changed to $category_roptselect$i then have a javascript group the radio buttons according to the $category part of the name.  then on the input page, I can strip the $category_ part???
0
 
newbe101Author Commented:
I will give it a shot... not very good with javascript.
0
 
newbe101Author Commented:
OK, Vincent.  I see what you are doing.  I put your code in the loop and everything seems to be working except for this line: group1Checked = document.formname.elements[i].id.  If I have $category right next to Checked (ie. $categoryChecked) it thinks the whole thing is the variable.  How do I get them together as two items with no spaces...?  I tried using a period, but is shows the period.  I also tired quotes, but I don't know if that will work for the javascript function.
0
 
VincentPugliaCommented:
Hi,

ok...'group1Checked' is simply a variable name; it could be anything you want.
  I didn't test the code (because I don't have any dataand am too lazy to make some up :) though it should work.
 essentially what I'm doing is looping through the form, testing each element for its name (could have just as easily been type= 'radio'), and once finding the first one, looping to see which was checked.  Upon finding that, I put the element's id into a variable which could then be used as you wish (to fill a hidden input field, sent separately, etc).

insofar as $categoryChecked:  you would have to concatenate them into a string ...and then turn them into a var (windows[concatenatedStr])  fortunately, that's not necessary....see above
0
 
newbe101Author Commented:
I did it with in the php loop.  And it gets the correct values.  I am going to check to see if you javasnipplet works... I will get back to you with the update.
0
 
VincentPugliaCommented:
if interested, there's code (with explanation) on looping through checkboxes that are used as radio buttons:

http://members.aol.com/grassblad/html/validForm.html

something I wrote up a long time ago in part because php'ers kept asking me the same question. :D
0
 
newbe101Author Commented:
It didn't work... I am going to see if it is changing the value.  Also, I will check out your code.
0
 
newbe101Author Commented:
by the way, here are the results... maybe I did something wrong:

<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><span class="style2"><td width="80%" align="left"><input name="Brakes" id="roptselect1" type="radio" onclick="this.form.total.value=calculateTotal(this);" value="33.00"/>
 <script>
 while (document.formname.elements[i].name == 'Brakes')
{
   if (document.formname.elements[i].checked)
      BrakesChecked = document.formname.elements[i].id
}
</script>
<input name="roptname1" type="hidden" value="Disk Brakes" /> <input name="ropt1" type="hidden" value="33.00" /> <input name="dopt1" type="hidden" value="22.00" /> <input name="copt1" type="hidden" value="12.00" />
 <a href="#" onmouseover="Tip('front only descrilpt descript<br><img src=\'../options/images/byc4697f99a11033.jpg\' width=\'250\'>')">Disk Brakes</a></td><td width="20%"align="right"><font color="white"><strong>$33.00</strong></font></td></span></tr><tr><span class="style2"><td width="80%" align="left"><input name="Brakes" id="roptselect2" type="radio" onclick="this.form.total.value=calculateTotal(this);" value="5000.00"/>
 <script>
 while (document.formname.elements[i].name == 'Brakes')
{
   if (document.formname.elements[i].checked)
      BrakesChecked = document.formname.elements[i].id
}
</script>
<input name="roptname2" type="hidden" value="Drum Brakes" /> <input name="ropt2" type="hidden" value="5000.00" /> <input name="dopt2" type="hidden" value="4000.00" /> <input name="copt2" type="hidden" value="3000.00" />
 <a href="#" onmouseover="Tip('5 Bolt drum brakes<br><img src=\'../options/images/byc468a8eede8271.jpg\' width=\'250\'>')">Drum Brakes</a></td><td width="20%"align="right"><font color="white"><strong>$5000.00</strong></font></td></span></tr><tr><span class="style2"><td width="80%" align="left"><input name="Brakes" id="roptselect3" type="radio" onclick="this.form.total.value=calculateTotal(this);" value="40"/>
 <script>
 while (document.formname.elements[i].name == 'Brakes')
{
   if (document.formname.elements[i].checked)
      BrakesChecked = document.formname.elements[i].id
}
</script>
<input name="roptname3" type="hidden" value="5 Bolt Brakes" /> <input name="ropt3" type="hidden" value="40" /> <input name="dopt3" type="hidden" value="30" /> <input name="copt3" type="hidden" value="20" />
 <a href="#" onmouseover="Tip('123456789012345678901234567890123456<br><img src=\'../options/images/byc468a8f07407e3.jpg\' width=\'250\'>')">5 Bolt Brakes</a></td><td width="20%"align="right"><font color="white"><strong>$40</strong></font></td></span></tr></table>
0
 
newbe101Author Commented:
Vincent,

what about something like this?
<INPUT TYPE="radio" NAME="$category" VALUE="$options_retail"  onClick="form.NAME.value = 'roptselect$i'">

but I would also need onclick=\"this.form.total.value=calculateTotal(this);\" to be included some how.
0
 
VincentPugliaCommented:
Hi,

This would be the function you need:

function doIt(formObj)
{
  for (var i = 0; i < formObj.length; i++)
      if (formObj.elements[i].type == 'radio')
          if (formObj.elements[i].name == 'Brakes' && formObj.elements[i].checked)
             BrakesChecked = formObj.elements[i].id
}

normally, you would call it  with your submit button (<input type='submit' onclick='doit(this.form)' />)
so that you can do additional validation/processing before executing the form's action.

if you have more than 1 group of radio buttons, you would need to do something like:
function doIt(formObj)
{
  for (var i = 0; i < formObj.length; i++)
      if (formObj.elements[i].type == 'radio')
      {
          if (formObj.elements[i].name == 'Brakes' && formObj.elements[i].checked)
             BrakesChecked = formObj.elements[i].id
          if (formObj.elements[i].name == 'Tires' && formObj.elements[i].checked)
             tiresChecked = formObj.elements[i].id
     }
}

in either case, you wouldn't use it to check immediately as you have done.  If that is what you want, you need to do something like this:

<input .......onclick="BrakesChecked = this.id;this.form.total.value=calculateTotal(this);" value="33.00....

In all cases you also nned to write out the variables between the <head> tags:

<head>
<script type='text/javascript'>
var BrakesChecked = "not checked";
....etc....
function doIt(formObj)
{
.....
}
</script>

Vinny


0
 
newbe101Author Commented:
ok, I think we're getting close... sorry for my ignorance.
here is what I have (I am only using brakes for radio buttons for now... once it works, I can do the rest):

<head>
...
</script>

<script language="Javascript1.2">
{
  for (var i = 0; i < formObj.length; i++)
      if (formObj.elements[i].type == \'radio\')
          if (formObj.elements[i].name == \'Brakes\' && formObj.elements[i].checked)
             BrakesChecked = formObj.elements[i].id
}
</script>
</head>

... then ...

$display_type = "<input name=\"$cat_row->category_category\" id=\"roptselect$i\" type=\"radio\" onclick=\"this.form.total.value=calculateTotal(this);\" value=\"$row->options_retail\"/>

... then ...

<input type="submit" name="Submit" value="Request Build" onclick=\'doit(this.form)\' />
(ignore the \'s obviously)

if you are getting the values for $i in the script, that is uneccessary because it is already handled in php.
0
 
VincentPugliaCommented:
don't know why you have the "\"s around  \'radio\ & \'Brakes\'  --- javascript doesn't use them that way.

my php efficiency is probably worse than your javascript :)
so...is it working?  what does the displayed output look like?
0
 
newbe101Author Commented:
it's getting the correct info, but it is not working... here is the final html result... maybe you can findout where it is going wrong...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
<!--
a:link {
      text-decoration: none;
      color: #CCCCCC;
}
a:visited {
      text-decoration: none;
      color: #CCCCCC;
}
a:hover {
      text-decoration: none;
      color: #CCCCCC;
}
a:active {
      text-decoration: none;
      color: #999999;
}
body {
      background-color: #CCCCCC;
      margin-left: 0px;
      margin-top: 0px;
}
body,td,th {
      font-size: 12px;
      color: #CCCCCC;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Automotive Legends BYC</title>

<script language="Javascript1.2">
am = "This function is disabled.";

bV  = parseInt(navigator.appVersion)
bNS = navigator.appName=="Netscape"
bIE = navigator.appName=="Microsoft Internet Explorer"

function nrc(e) {
   if (bNS && e.which > 1){
      alert(am)
      return false
   } else if (bIE && (event.button >1)) {
     alert(am)
     return false;
   }
}

document.onmousedown = nrc;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (bNS && bV<5) window.onmousedown = nrc;

</script>

<script language="Javascript1.2">
{
  for (var i = 0; i < formObj.length; i++)
      if (formObj.elements[i].type == 'radio')
          if (formObj.elements[i].name == 'Brakes' && formObj.elements[i].checked)
             BrakesChecked = formObj.elements[i].id
}
</script>


</head>

<body onload="InitForm();" onreset="InitForm();">
<script type="text/javascript" src="../script/wz_tooltip.js"></script>
<script type="text/javascript" src="../write/ErodSS.js"></script><br>
  <form method="POST" name="selectionForm" action="../leads/add2.php">
  <table width="400" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td bgcolor="#333333">header</td>
  </tr>
</table>
    <table width="670" border="0" cellspacing="0" cellpadding="5">
    <tr>
      <td bgcolor="#666666"><table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr>
          <td width="53%" align="left" valign="top"><table width="300" border="2" cellpadding="0" cellspacing="0" bordercolor="#FFBC5B">
            <tr>
              <td><p>
                  <input name="leads_make" type="hidden" value="Erod" /><input name="leads_model" type="hidden" value="SS" /><input name="leads_status" type="hidden" value="New" /><img src="../vehicle/images/byc469ebb171a804.jpg" width="350" height="300" /></p></td>
            </tr>
          </table><center><font color="#993300"><i>Click on the image above for more pictures.</i></font></center><br>Real cool electric car.       
            <br><br><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="49%" align="left" valign="top"><div align="left">
                    <input name="leads_name" type="text" size="20" />
                </div></td>
                <td colspan="2" align="left" valign="top"><div align="left">
                    <input name="leads_phone" type="text" size="20" />
                </div></td>
              </tr>
              <tr>
                <td align="left" valign="top"><div align="left">name</div></td>
                <td colspan="2" align="left" valign="top"><div align="left">phone</div></td>
              </tr>
              <tr>
                <td align="left" valign="top"><div align="left">
                    <input name="leads_address1" type="text" size="20" />
                </div></td>
                <td colspan="2" align="left" valign="top"><div align="left">
                    <input name="leads_email" type="text" size="20" />
                </div></td>
              </tr>
              <tr>
                <td align="left" valign="top"><div align="left">address</div></td>
                <td colspan="2" align="left" valign="top"><div align="left">email</div></td>
              </tr>
              <tr>
                <td align="left" valign="top"><div align="left">
                    <input name="leads_city" type="text" size="20" />
                </div></td>
                <td width="17%" align="left" valign="top"><div align="left">
                    <input name="leads_state" type="text" size="3" />
                </div></td>
                <td width="34%" align="left" valign="top"><div align="left">
                    <input name="leads_zip" type="text" size="10" />
                </div></td>
              </tr>
              <tr>
                <td align="left" valign="top"><div align="left">city</div></td>
                <td align="left" valign="top"><div align="left">state</div></td>
                <td align="left" valign="top"><div align="left">zip</div></td>
              </tr>
            </table>            
            <p><style type="text/css"><!--
.style2 {font-size: 12px; }
--></style><img src="../options/images/divide2.gif"><br><br><span class="style2"><b><font color="#333333">Engine</font></b></span> <table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><span class="style2"><td width="80%" align="left"><input name="roptselect4" type="checkbox" onclick="this.form.total.value=calculateTotal(this);" value="3000"/> <input name="roptname4" type="hidden" value="1915cc" /> <input name="ropt4" type="hidden" value="3000" /> <input name="dopt4" type="hidden" value="2000" /> <input name="copt4" type="hidden" value="1000" />
 <a href="#" onmouseover="Tip('190HP 1915cc engine<br><img src=\'../options/images/byc4695656108839.jpg\' width=\'250\'>')">1915cc</a></td><td width="20%"align="right"><font color="white"><strong>$3000</strong></font></td></span></tr></table><br><style type="text/css"><!--
.style2 {font-size: 12px; }
--></style><img src="../options/images/divide2.gif"><br><br><span class="style2"><b><font color="#333333">Electrical</font></b></span> <table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><span class="style2"></span></tr><tr><span class="style2"></span></tr><tr><span class="style2"></span></tr></table><br><style type="text/css"><!--
.style2 {font-size: 12px; }
--></style><img src="../options/images/divide2.gif"><br><br><span class="style2"><b><font color="#333333">Exterior Color</font></b></span> <table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><span class="style2"></span></tr><tr><span class="style2"></span></tr><tr><span class="style2"></span></tr></table><br>
            </p></td>
          <td width="47%" align="left" valign="top"><p><style type="text/css"><!--
.style2 {font-size: 12px; }
--></style><img src="../options/images/divide2.gif"><br><br><span class="style2"><b><font color="#333333">Brakes</font></b></span> <table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><span class="style2"><td width="80%" align="left"><input name="Brakes" id="roptselect1" type="radio" onclick="this.form.total.value=calculateTotal(this);" value="33.00"/>
 

<input name="roptname1" type="hidden" value="Disk Brakes" /> <input name="ropt1" type="hidden" value="33.00" /> <input name="dopt1" type="hidden" value="22.00" /> <input name="copt1" type="hidden" value="12.00" />
 <a href="#" onmouseover="Tip('front only descrilpt descript<br><img src=\'../options/images/byc4697f99a11033.jpg\' width=\'250\'>')">Disk Brakes</a></td><td width="20%"align="right"><font color="white"><strong>$33.00</strong></font></td></span></tr><tr><span class="style2"><td width="80%" align="left"><input name="Brakes" id="roptselect2" type="radio" onclick="this.form.total.value=calculateTotal(this);" value="5000.00"/>
 

<input name="roptname2" type="hidden" value="Drum Brakes" /> <input name="ropt2" type="hidden" value="5000.00" /> <input name="dopt2" type="hidden" value="4000.00" /> <input name="copt2" type="hidden" value="3000.00" />
 <a href="#" onmouseover="Tip('5 Bolt drum brakes<br><img src=\'../options/images/byc468a8eede8271.jpg\' width=\'250\'>')">Drum Brakes</a></td><td width="20%"align="right"><font color="white"><strong>$5000.00</strong></font></td></span></tr><tr><span class="style2"><td width="80%" align="left"><input name="Brakes" id="roptselect3" type="radio" onclick="this.form.total.value=calculateTotal(this);" value="40"/>
 

<input name="roptname3" type="hidden" value="5 Bolt Brakes" /> <input name="ropt3" type="hidden" value="40" /> <input name="dopt3" type="hidden" value="30" /> <input name="copt3" type="hidden" value="20" />
 <a href="#" onmouseover="Tip('123456789012345678901234567890123456<br><img src=\'../options/images/byc468a8f07407e3.jpg\' width=\'250\'>')">5 Bolt Brakes</a></td><td width="20%"align="right"><font color="white"><strong>$40</strong></font></td></span></tr></table><br><style type="text/css"><!--
.style2 {font-size: 12px; }
--></style><img src="../options/images/divide2.gif"><br><br><span class="style2"><b><font color="#333333">Tires</font></b></span> <table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><span class="style2"><td width="80%" align="left"><input name="roptselect5" type="checkbox" onclick="this.form.total.value=calculateTotal(this);" value="10"/> <input name="roptname5" type="hidden" value="fdas" /> <input name="ropt5" type="hidden" value="10" /> <input name="dopt5" type="hidden" value="9" /> <input name="copt5" type="hidden" value="8" />
 <a href="#" onmouseover="Tip('test  test test<br><img src=\'../options/images/byc468a8f4d4f051.jpg\' width=\'250\'>')">fdas</a></td><td width="20%"align="right"><font color="white"><strong>$10</strong></font></td></span></tr><tr><span class="style2"><td width="80%" align="left"><input name="roptselect6" type="checkbox" onclick="this.form.total.value=calculateTotal(this);" value="3"/> <input name="roptname6" type="hidden" value="asdf" /> <input name="ropt6" type="hidden" value="3" /> <input name="dopt6" type="hidden" value="2" /> <input name="copt6" type="hidden" value="1" />
 <a href="#" onmouseover="Tip('sdf<br><img src=\'../options/images/byc4689a508678e2.jpg\' width=\'250\'>')">asdf</a></td><td width="20%"align="right"><font color="white"><strong>$3</strong></font></td></span></tr><tr><span class="style2"><td width="80%" align="left"><img src="../script/checked.gif"> <input name="roptselect7" type="hidden" value="3" /> <input name="roptname7" type="hidden" value="asdf" /> <input name="ropt7" type="hidden" value="std" /> <input name="dopt7" type="hidden" value="std" /> <input name="copt7" type="hidden" value="std" /> <a href="#" onmouseover="Tip('sdf<br><img src=\'../options/images/byc468a8e64704f9.jpg\' width=\'250\'>')">asdf</a></td><td width="20%"align="right"><font color="white"><strong>std</strong></font></td></span></tr><tr><span class="style2"><td width="80%" align="left"><input name="roptselect8" type="checkbox" onclick="this.form.total.value=calculateTotal(this);" value="395.00"/> <input name="roptname8" type="hidden" value="White Walls" /> <input name="ropt8" type="hidden" value="395.00" /> <input name="dopt8" type="hidden" value="300.00" /> <input name="copt8" type="hidden" value="199.00" />
 <a href="#" onmouseover="Tip('225 X 15<br><img src=\'../options/images/byc469eba27d21b1.jpg\' width=\'250\'>')">White Walls</a></td><td width="20%"align="right"><font color="white"><strong>$395.00</strong></font></td></span></tr></table><br><style type="text/css"><!--
.style2 {font-size: 12px; }
--></style><img src="../options/images/divide2.gif"><br><br><span class="style2"><b><font color="#333333">Interior</font></b></span> <table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><span class="style2"><td width="80%" align="left"><input name="roptselect9" type="checkbox" onclick="this.form.total.value=calculateTotal(this);" value="225"/> <input name="roptname9" type="hidden" value="Leather Seats" /> <input name="ropt9" type="hidden" value="225" /> <input name="dopt9" type="hidden" value="150" /> <input name="copt9" type="hidden" value="100" />
 <a href="#" onmouseover="Tip('German leather seats<br><img src=\'../options/images/byc468a8f77cc89e.jpg\' width=\'250\'>')">Leather Seats</a></td><td width="20%"align="right"><font color="white"><strong>$225</strong></font></td></span></tr><tr><span class="style2"><td width="80%" align="left"><img src="../script/checked.gif"> <input name="roptselect10" type="hidden" value="6" /> <input name="roptname10" type="hidden" value="test" /> <input name="ropt10" type="hidden" value="std" /> <input name="dopt10" type="hidden" value="std" /> <input name="copt10" type="hidden" value="std" /> <a href="#" onmouseover="Tip('test<br><img src=\'../options/images/byc46955f9677549.jpg\' width=\'250\'>')">test</a></td><td width="20%"align="right"><font color="white"><strong>std</strong></font></td></span></tr></table><br></p>
            <p>
              <input type="hidden" name="calculatedTotal" value="0" />
              <input type="hidden" name="previouslySelectedRadioButton" value="0" />
</p>
            <table width="279" border="0" cellspacing="0" cellpadding="0">
              <tr bgcolor="44474E">
                <td width="10" bgcolor="#44474e">&nbsp;</td>
                <td width="160" bgcolor="#44474e">&nbsp;</td>
                <td width="109">&nbsp;</td>
              </tr>
              <tr bgcolor="FFBC5B">
                <td>&nbsp;</td>
                <td><font color="#333333" size="-1">MSRP</font><strong></strong></td>
                <td><strong><font color="#333333" size="-1">$29995.00 <input name="leads_msrp" type="hidden" value="29995.00" /><input name="leads_dealer" type="hidden" value="19000.00" /><input name="leads_cost" type="hidden" value="12000.00" /></font></strong></td>
              </tr>
              <tr bgcolor="FFBC5B">
                <td>&nbsp;</td>
                <td><font color="#333333" size="-1">Handling</font></td>
                <td><strong><font color="#333333" size="-1">$550 <input name="leads_shipping" type="hidden" value="550" /></font></strong></td>
              </tr>
              <tr bgcolor="FFBC5B">
                <td>&nbsp;</td>
                <td><font color="#333333" size="-1">Options</font></td>
                <td><input type="text" name="optionstotal" readonly="readonly" size="10" onfocus="this.blur();" />
                </td>
              </tr>
              <tr bgcolor="FFBC5B">
                <td>&nbsp;</td>
                <td><strong><font color="#333333" size="-1">Grand Total</font></strong></td>
                <td><input type="text" name="total" readonly="readonly" size="10" onfocus="this.blur();" />
                </td>
              </tr>
            </table>
            <table width="279" border="0" cellspacing="0" cellpadding="0">
              <tr bgcolor="FFBC5B">
                <td height="15"><table width="100%" border="0" cellspacing="0" cellpadding="5">
                    <tr>
                      <td><font color="#333333" size="-1"><i>*Pricing may change without notice</i></font><font size="-1">&nbsp; </font><br />
                          <input name="button" type="button" onclick="history.go(0)" value="Reset Form" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="submit" name="Submit" value="Request Build" onclick='doit(this.form)' /></td>
                    </tr>
                </table></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
    </tr>
  </table>
  </form>
</body></html>
0
 
VincentPugliaCommented:
ok.. you inserted the code, but it's not within a function...so if it tries to execute, it will crash. also, you never declare BrakesChecked as a variable.

do you want  to execute the code when the user clicks on the radio button or when  they click on one of the other buttons?

where and how do you want to store BrakesChecked?
0
 
newbe101Author Commented:
We never finished this, and it seems like we never will.... so I am closing it.  THanks for the attempt.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 11
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now