Jump to content

how to populate webage on event


alanl1
Go to solution Solved by alanl1,

Recommended Posts

Hi Professionals.

 

I have a webpage that pulls in a spreadsheet and creates some drop down boxes

 

I also have a checkbox with a "one to many" option

 

so in other words

 

if user ticks the "one to many" option they can see so many dropdown boxes like so

 

Drop1 <--matches--> Drop2, Drop3,Drop4

 

if the user unticks the "ony to many" option then they can only see dropdown boxes like so

 

Drop1 <--matches--> Drop2

 

Can this be done

 

I hope you understand what I mean, at the moment i just have a calc function to display an alert if it is checked or not

 

Here is my coded page

<head>
<script type="text/javascript">
var categories = [];
 categories["startList"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"]
 categories["Manufacturer"] = ["DeviceID","Product","Version","NULL","Ignore"];
 categories["DeviceID"] = ["Manufacturer","Product","Version","NULL","Ignore"];
 categories["Product"] = ["DeviceID","Manufacturer","Version","NULL","Ignore"];
 categories["Version"] = ["DeviceID","Manufacturer","Product","NULL","Ignore"];
 categories["NULL"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"];
 categories["Ignore"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"];
 
 categories["startList2"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"]
 categories["Manufacturer2"] = ["DeviceID","Product","Version","NULL","Ignore"];
 categories["DeviceID2"] = ["Manufacturer","Product","Version","NULL","Ignore"];
 categories["Product2"] = ["DeviceID","Manufacturer","Version","NULL","Ignore"];
 categories["Version2"] = ["DeviceID","Manufacturer","Product","NULL","Ignore"];
 categories["NULL2"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"];
 categories["Ignore2"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"];
 
 categories["startList3"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"]
 categories["Manufacturer3"] = ["DeviceID","Product","Version","NULL","Ignore"];
 categories["DeviceID3"] = ["Manufacturer","Product","Version","NULL","Ignore"];
 categories["Produc3t"] = ["DeviceID","Manufacturer","Version","NULL","Ignore"];
 categories["Version3"] = ["DeviceID","Manufacturer","Product","NULL","Ignore"];
 categories["NULL3"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"];
 categories["Ignore3"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"];
 
 function calc()
  {
  //document.getElementById("cbox").checked=true
     var cbox = document.getElementById('cbox');
    if (cbox.checked){
        alert("checked") ;
    }else{
        alert("Not checked.")
    }
 }

function fillSelect(sel,ary,nxt){
 if (ary&&sel.form){
  var frm=sel.form,nme=sel.name.replace(/\d/g,""),i=Number(sel.name.replace(/\D/g,""))+1,nxt=frm[nxt],z0=0;
  while (frm[nme+i]){
   frm[nme+i].length = 1;
   frm[nme+i].selectedIndex=0;
   i++;
  }
  for (;z0<ary.length;z0++){
   nxt.options[z0+1]=new Option(ary[z0],ary[z0]);
  }
  nxt.selectedIndex=0;
 }
}
function getValue(isValue) {
 alert(isValue);
}
function init() {
 fillSelect(document.forms[0]['dropdown0'],categories['startList'],'dropdown0')
  fillSelect(document.forms[0]['secondDD'],categories['startList2'],'secondDD')
   fillSelect(document.forms[0]['thirdDD'],categories['startList3'],'thirdDD')
}
navigator.appName == "Microsoft Internet Explorer" ? attachEvent('onload', init, false) : addEventListener('load', init, false);
function myfunction()
{
alert("Please ensure the file is in csv format");
}
 </script>
</head>
<?php include("header.php"); ?>
<?php include("footer.php"); ?>
 <form action=""><?php
 
$newname = $_GET['newname'];  //The file that has been moved into the Uploads/ folder will need to be stripped here to retreive just the filename...
$filename = basename($newname,"/");  //basename function strips off filename based on first forward slash "/"
// Three counter variables necessary for looping purposes for dynmaic drop down box javascript client side functions
$counter = 1;
$counter1 = 1;
$counter2 = 1;
function ext($file) {
 return substr(strrchr($file,'.'),1);
}
if (isset($filename)) {
$cfile = $filename;
$cfile = ext($cfile);
if ($cfile == 'csv'){
//do nothing its all good..
}
else {
 
 ?><script type="text/javascript">
    myfunction();
</script><?php
header("refresh:1; url=preupload.php");
}
}
    if (($handle = fopen($filename, "r")) !== FALSE)    
 {        
 $length = 1000;        
 $delimiter = ",";   ?>   
 <?php
 $rows = 0;  // ADDED        
 while ( ( $data = fgetcsv( $handle, $length, $delimiter ) ) !== FALSE )        
 {        
 if( $rows == 0 )// or rows = 3 using pipe command|| $rows == 3 ) // ADDED        
 {                
   $num = count($data);
   echo "<table width=100% border=0>"; 
   echo "<tr width=100% align=center><td colspan=4>&nbsp</td></tr>";
   echo "<tr width=100% align=center><td colspan=4 style=white-space:nowrap;width:100%;></td></tr>";
  
   echo "<tr width=100% align=center><td colspan=4>Here we need info to assist user</td></tr>";  
    echo "<tr width=100%><td width=25%>&nbsp</td>
    <td width=20%>&nbsp</td>
    <td width=15%> </td>
    <td width=40%> </td></tr>";
    echo "<tr width=100%><td width=25% align=right>&nbsp</td>
    <td colspan=3>By selecting one to many selection box will allow to split and cleanse the desired column into a maximum of 3 from the dropdown boxes</td></tr>";              echo "<tr width=100%><td width=25% align=right>&nbsp</td>
    <td colspan=3>By not selecting one to many will only allow for first set of dropdown boxes to cleanse data</td></tr>";
    echo "<tr width=100%><td width=25% align=right>&nbsp</td>
    <td colspan=3>&nbsp</td></tr>";
    echo "<tr width=100%><td width=25% align=right>&nbsp</td>
    <td width=20%><input type=checkbox id=cbox name=cbox value=unselected onclick=calc();>One to many</td>
    <td width=15%> </td>
    <td width=40%> </td></tr>";
    echo "<tr width=100%><td width=25%> </td>
    <td width=20%>&nbsp</td>
    <td width=15%> </td>
    <td width=40%> </td></tr>";
 echo "</table>";
   for ($c=0; $c < $num; $c++)                
    { 
   echo "<table width=100% border=0>";
   
    echo "<tr width=25% align=right><td>";
    //Second array element populates the dropdown and calculates the number of columns from spreadsheet
    for ($d=0; $d < $num; $d++)                
    {  
     //echo "<option value='" .$data[$d]."'>" .$data[$d]."</option>";
   }
   echo "<input type='text' id='".$data[$c]."' value='".$data[$c]."' DISABLED='disabled' style='background-color:White; color:Black;'>";
    echo "</td>";
      echo "<td width=20% align=left>";
      ?> <---- Matches to -----> <select name="<?php echo "dropdown" .$c?>" onchange="fillSelect(this,categories[this.value],'<?php echo "dropdown" .$counter++ ?>')"><?php
      echo "<option selected>Please Choose</option>";
      echo "<option value='DeviceID'>DeviceID</option>";
      echo "<option value='Product'>Product</option>";
      echo "<option value='Manufacturer'>Manufacturer</option>";
      echo "<option value='Version'>Version</option>";
      echo "<option value='NULL'>NULL</option>";
      echo "<option value='Ignore'>Ignore</option>";   
      ?></select><?php
      echo "</td>";
     echo "<td width=15% align=left>";
     ?> <select name="<?php echo "secondDD" .$c?>" onchange="fillSelect(this,categories[this.value],'<?php echo "secondDD" .$counter1++ ?>')"><?php
      echo "<option selected>Please Choose</option>";
      echo "<option value='DeviceID2'>DeviceID</option>";
      echo "<option value='Product2'>Product</option>";
      echo "<option value='Manufacturer2'>Manufacturer</option>";
      echo "<option value='Version2'>Version</option>";
      echo "<option value='NULL2'>NULL</option>";
      echo "<option value='Ignore2'>Ignore</option>";   
      ?></select><?php
      echo "</td>";
      echo "<td width=40% align=left>";
     ?> <select name="<?php echo "thirdDD" .$c?>" onchange="fillSelect(this,categories[this.value],'<?php echo "thirdDD" .$counter2++ ?>')"><?php
      echo "<option selected>Please Choose</option>";
      echo "<option value='DeviceID3'>DeviceID</option>";
      echo "<option value='Product3'>Product</option>";
      echo "<option value='Manufacturer3'>Manufacturer</option>";
      echo "<option value='Version3'>Version</option>";
      echo "<option value='NULL3'>NULL</option>";
      echo "<option value='Ignore3'>Ignore</option>";   
      ?></select><?php
      echo "</td>";
    echo "</tr>";
    echo "</table>"; 
    }                                 
 }       
 $rows++; // ADDED      
 }              
  fclose($handle);    
}
?></form>
Edited by Zane
use CODE tags please, there is no point in pasting that much information.
Link to comment
Share on other sites

Terms of Service

 

 

4. Users will format posts as best as they can by using proper


or

tags and following Proper Code Indentation guidelines.

 

He is free to be bored; frankly I am, too. I usually don't even bother to scroll through large chunks of code (that's 200 lines you posted) that are not even in code tags. It is nearly impossible to read.

 

Since this is a forum of volunteers, you would get better responses if you follow the rules and make it as easy as possible for someone to spend their personal free time trying to help you.

Link to comment
Share on other sites

I have broken it down if you are struggling to understand

 

basically I want to show my dropdown boxes with this code

 

 function show_hide(o){
   var cbox = document.getElementById('cbox');
    
  if (cbox.checked){
    alert("checkbox has been selected") ;
   document.getElementById('secondDD1').style.display = 'block';
   document.getElementById('thirdDD1').style.display = 'block';
   }
   else
   {
     alert("checkbox has been de-selected") ;
    document.getElementById('secondDD1').style.display = 'none';
    document.getElementById('thirdDD1').style.display = 'none';
    }

 

but it doesnt work my dropdowns are still hidden and dont show up

 

 

<select name="<?php echo "secondDD" .$c  ?>" style="display:none" onchange="fillSelect(this,categories[this.value],'<?php echo "secondDD" .$counter1++ ?>')">

Link to comment
Share on other sites

i have got this far after looking around on the web at other people with similar problems but it still will not show and hide the dropdowns.

 

the alerts fire ok but no the rest

 

any ideas

 

 

 function show_hide(){
   var cbox = document.getElementById('cbox');
    
  if (cbox.checked){
    alert("checkbox has been selected") ;
   document.getElementById('thirdDD0').style.display = 'block';
   document.getElementById('thirdDD0').disabled = false;
   document.getElementsByName('thirdDD0').style.display = 'block';
   document.getElementsByName('thirdDD0').disabled = false;
   }
   else
   {
     alert("checkbox has been de-selected") ;
    document.getElementById('thirdDD0').disabled = true;
    document.getElementById('thirdDD0').style.display = 'none';
    document.getElementsByName('thirdDD0').disabled = true;
    document.getElementsByName('thirdDD0').style.display = 'none';
    }
   }

Link to comment
Share on other sites

Commenting on code is a good fashion when asking for help.

jQuery's documentation on good coding style is a good guideline for writing readable, comprehensible code. I stopped reading and your if(ary&&sel.form) condition check because I couldn't see any hint of comments you may have made, your for loop just is a string of data I can't read on my phone.

I suggest you re-write your code and include comments. Remember, 1 hour of thinking thoroughly before coding saves 8 hours of correcting the code you have written without thinking before writing it.

Link to comment
Share on other sites

ok guys I have broken this right down for ease of reading.

 

I have a function which is suposed to show and hide my dropdown box but it doesnt fire, the alert fires but the dropdown wont disappear.  any ideas

 

 

 
 echo "<tr width=100%><td width=25% align=right>&nbsp</td>
    <td width=20%>
    <input type=checkbox id=cbox name=cbox value=unselected onclick=show_hide(this.checked);>One to many</td>
    <td width=15%> </td>
 

 

 

function show_hide( isChecked )
{
 alert("checkbox has been selected") ;
  document.getElementById('secondDD1').style.display = ( isChecked ? 'block' : 'none' );
  document.getElementById('secondDD1').disabled = !isChecked;
}

 

 

<select name="<?php echo "secondDD" .$c  ?>" onchange="fillSelect(this,categories[this.value],'<?php echo "secondDD" .$counter1++ ?>')"><?php
      echo "<option selected>Please Choose</option>";
      echo "<option value='DeviceID2'>DeviceID</option>";
      echo "<option value='Product2'>Product</option>";
      ?></select>
Link to comment
Share on other sites

Now that there are some code tags...

 

You have multiple issues in your code that need to be corrected, many of which could contribute to your boxes not showing.

 

1) Surround attributes of HTML tags in quotes. 

<input type=checkbox id=cbox name=cbox value=unselected onclick=show_hide(this.checked);>

This code should look like this
 

<input type="checkbox" id="cbox" name="cbox" value="unselected" onclick="show_hide(this.checked);">

You can add backslashes if you are outputting in a string (IE type=\"checkbox\")

 

2) You need to post the output of the HTML so we can see that your select boxes are named properly.

 

3) This select is not hidden from the beginning. I would imagine it would not "show up" after you click on it, since it's already visible.

<select name="<?php echo "secondDD" .$c  ?>" onchange="fillSelect(this,categories[this.value],'<?php echo "secondDD" .$counter1++ ?>')"><?php
      echo "<option selected>Please Choose</option>";
      echo "<option value='DeviceID2'>DeviceID</option>";
      echo "<option value='Product2'>Product</option>";
      ?></select>

4) jQuery helps simplify this stuff a lot.

Link to comment
Share on other sites

ok thanks for that

 

I have now made this invisible from the start with

 

 

 
<select name="<?php echo "secondDD" .$c  ?>" style="display: none;" onchange="fillSelect(this,categories[this.value],'<?php echo "secondDD" .$counter1++ ?>')">

 

my checkbox is in a string as follows

 

 

echo "<tr width=100%><td width=25% align=right>&nbsp</td>
    <td width=20%>
    <input type=checkbox id=cbox name=cbox value=unselected onclick=show_hide(this.checked);>One to many</td>
    <td width=15%> </td>
    <td width=40%> </td></tr>";
 

any ideas

Link to comment
Share on other sites

and the html as requested

 

 

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>linefeeds1</title>
</head>
<body>
<script type="text/javascript">
var categories = [];
categories["startList"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"]
categories["Manufacturer"] = ["DeviceID","Product","Version","NULL","Ignore"];
categories["DeviceID"] = ["Manufacturer","Product","Version","NULL","Ignore"];
categories["Product"] = ["DeviceID","Manufacturer","Version","NULL","Ignore"];
categories["Version"] = ["DeviceID","Manufacturer","Product","NULL","Ignore"];
categories["NULL"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"];
categories["Ignore"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"];
 
categories["startList2"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"]
categories["Manufacturer2"] = ["DeviceID","Product","Version","NULL","Ignore"];
categories["DeviceID2"] = ["Manufacturer","Product","Version","NULL","Ignore"];
categories["Product2"] = ["DeviceID","Manufacturer","Version","NULL","Ignore"];
categories["Version2"] = ["DeviceID","Manufacturer","Product","NULL","Ignore"];
categories["NULL2"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"];
categories["Ignore2"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"];
 
categories["startList3"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"]
categories["Manufacturer3"] = ["DeviceID","Product","Version","NULL","Ignore"];
categories["DeviceID3"] = ["Manufacturer","Product","Version","NULL","Ignore"];
categories["Product3"] = ["DeviceID","Manufacturer","Version","NULL","Ignore"];
categories["Version3"] = ["DeviceID","Manufacturer","Product","NULL","Ignore"];
categories["NULL3"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"];
categories["Ignore3"] = ["DeviceID","Manufacturer","Product","Version","NULL","Ignore"];
function show_hide( isChecked )
{
alert("checkbox has been selected") ;
document.getElementById('secondDD1').style.display = ( isChecked ? 'block' : 'none' );
document.getElementById('secondDD1').disabled = !isChecked;
} 
function fillSelect(sel,ary,nxt){
if (ary&&sel.form){
var frm=sel.form,nme=sel.name.replace(/\d/g,""),i=Number(sel.name.replace(/\D/g,""))+1,nxt=frm[nxt],z0=0;
while (frm[nme+i]){
frm[nme+i].length = 1;
frm[nme+i].selectedIndex=0;
i++;
}
for (;z0<ary.length;z0++){
nxt.options[z0+1]=new Option(ary[z0],ary[z0]);
}
nxt.selectedIndex=0;
}
}
function getValue(isValue) {
alert(isValue);
}
function init() {
fillSelect(document.forms[0]['dropdown0'],categories['startList'],'dropdown0') 
fillSelect(document.forms[0]['secondDD0'],categories['startList2'],'secondDD0') 
fillSelect(document.forms[0]['thirdDD0'],categories['startList3'],'thirdDD0') 
}
navigator.appName == "Microsoft Internet Explorer" ? attachEvent('onload', init, false) : addEventListener('load', init, false);
function myfunction()
{
alert("Please ensure the file is in csv format");
}
</script>
 
<style type="text/css">
.specialImage{
position:fixed;
bottom:0;
right:0;
z-index:100; /* or higher/lower depending on other elements */
}
</style>
<table width="100%" border="0">
<tr>
<td width="33%"> </td>
<td width="33%"><img src="images/Data3.jpg" width="389" height="100" alt="Data33" align="middle"></td>
<td width="33%"> </td>
</tr>
</table> 
<style type="text/css">
.specialImage{
position:fixed;
bottom:0;
right:0;
z-index:100; /* or higher/lower depending on other elements */
}
</style>
<img src="images/MCP.jpg" class="specialImage" width="120" height="90" alt="Microsoft Certified Partner">
<form method='POST' name="myform" action="test.php" > 
<table width=100% border=0><tr width=100% align=center><td colspan=4>&nbsp</td></tr><tr width=100% align=center><td colspan=4 style=white-space:nowrap;width:100%;></td></tr><tr width=100% align=center><td colspan=4>Here we need info to assist user</td></tr><tr width=100%><td width=25%>&nbsp</td>
<td width=20%>&nbsp</td>
<td width=15%> </td>
<td width=40%> </td></tr><tr width=100%><td width=25% align=right>&nbsp</td>
<td colspan=3>By selecting one to many selection box will allow to split and cleanse the desired column into a maximum of 3 from the dropdown boxes</td></tr><tr width=100%><td width=25% align=right>&nbsp</td>
<td colspan=3>By not selecting one to many will only allow for first set of dropdown boxes to cleanse data</td></tr><tr width=100%><td width=25% align=right>&nbsp</td>
<td colspan=3>&nbsp</td></tr><tr width=100%><td width=25% align=right>&nbsp</td>
<td width=20%>
<input type=checkbox id=cbox name=cbox value=unselected onclick=show_hide(this.checked);>One to many</td>
<td width=15%> </td>
<td width=40%> </td></tr><tr width=100%><td width=25%> </td>
<td width=20%>&nbsp</td>
<td width=15%> </td>
<td width=40%> </td></tr></table><table width=100% border=0><tr width=25% align=right><td><input type='text' id='Software Man' value='Software Man' DISABLED='disabled' style='background-color:White; color:Black;'></td><td width=20% align=left> <---- Matches to -----> <select name="dropdown0" onchange="fillSelect(this,categories[this.value],'dropdown1')"><option selected>Please Choose</option><option value='DeviceID'>DeviceID</option><option value='Product'>Product</option><option value='Manufacturer'>Manufacturer</option><option value='Version'>Version</option><option value='NULL'>NULL</option><option value='Ignore'>Ignore</option></select></td><td width=15% align=left> <select name="secondDD0" style="display: none;" onchange="fillSelect(this,categories[this.value],'secondDD1')"><option selected>Please Choose</option><option value='DeviceID2'>DeviceID</option><option value='Product2'>Product</option><option value='Manufacturer2'>Manufacturer</option><option value='Version2'>Version</option><option value='NULL2'>NULL</option><option value='Ignore2'>Ignore</option></select></td><td width=40% align=left> <select name="thirdDD0" style="display: none;" onchange="fillSelect(this,categories[this.value],'thirdDD1')"><option selected>Please Choose</option><option value='DeviceID3'>DeviceID</option><option value='Product3'>Product</option><option value='Manufacturer3'>Manufacturer</option><option value='Version3'>Version</option><option value='NULL3'>NULL</option><option value='Ignore3'>Ignore</option></select></td></tr></table><table width=100% border=0><tr width=25% align=right><td><input type='text' id='Part Number' value='Part Number' DISABLED='disabled' style='background-color:White; color:Black;'></td><td width=20% align=left> <---- Matches to -----> <select name="dropdown1" onchange="fillSelect(this,categories[this.value],'dropdown2')"><option selected>Please Choose</option><option value='DeviceID'>DeviceID</option><option value='Product'>Product</option><option value='Manufacturer'>Manufacturer</option><option value='Version'>Version</option><option value='NULL'>NULL</option><option value='Ignore'>Ignore</option></select></td><td width=15% align=left> <select name="secondDD1" style="display: none;" onchange="fillSelect(this,categories[this.value],'secondDD2')"><option selected>Please Choose</option><option value='DeviceID2'>DeviceID</option><option value='Product2'>Product</option><option value='Manufacturer2'>Manufacturer</option><option value='Version2'>Version</option><option value='NULL2'>NULL</option><option value='Ignore2'>Ignore</option></select></td><td width=40% align=left> <select name="thirdDD1" style="display: none;" onchange="fillSelect(this,categories[this.value],'thirdDD2')"><option selected>Please Choose</option><option value='DeviceID3'>DeviceID</option><option value='Product3'>Product</option><option value='Manufacturer3'>Manufacturer</option><option value='Version3'>Version</option><option value='NULL3'>NULL</option><option value='Ignore3'>Ignore</option></select></td></tr></table><table width=100% border=0><tr width=25% align=right><td><input type='text' id='Product Name' value='Product Name' DISABLED='disabled' style='background-color:White; color:Black;'></td><td width=20% align=left> <---- Matches to -----> <select name="dropdown2" onchange="fillSelect(this,categories[this.value],'dropdown3')"><option selected>Please Choose</option><option value='DeviceID'>DeviceID</option><option value='Product'>Product</option><option value='Manufacturer'>Manufacturer</option><option value='Version'>Version</option><option value='NULL'>NULL</option><option value='Ignore'>Ignore</option></select></td><td width=15% align=left> <select name="secondDD2" style="display: none;" onchange="fillSelect(this,categories[this.value],'secondDD3')"><option selected>Please Choose</option><option value='DeviceID2'>DeviceID</option><option value='Product2'>Product</option><option value='Manufacturer2'>Manufacturer</option><option value='Version2'>Version</option><option value='NULL2'>NULL</option><option value='Ignore2'>Ignore</option></select></td><td width=40% align=left> <select name="thirdDD2" style="display: none;" onchange="fillSelect(this,categories[this.value],'thirdDD3')"><option selected>Please Choose</option><option value='DeviceID3'>DeviceID</option><option value='Product3'>Product</option><option value='Manufacturer3'>Manufacturer</option><option value='Version3'>Version</option><option value='NULL3'>NULL</option><option value='Ignore3'>Ignore</option></select></td></tr></table><table width=100% border=0><tr width=25% align=right><td><input type='text' id='Edition' value='Edition' DISABLED='disabled' style='background-color:White; color:Black;'></td><td width=20% align=left> <---- Matches to -----> <select name="dropdown3" onchange="fillSelect(this,categories[this.value],'dropdown4')"><option selected>Please Choose</option><option value='DeviceID'>DeviceID</option><option value='Product'>Product</option><option value='Manufacturer'>Manufacturer</option><option value='Version'>Version</option><option value='NULL'>NULL</option><option value='Ignore'>Ignore</option></select></td><td width=15% align=left> <select name="secondDD3" style="display: none;" onchange="fillSelect(this,categories[this.value],'secondDD4')"><option selected>Please Choose</option><option value='DeviceID2'>DeviceID</option><option value='Product2'>Product</option><option value='Manufacturer2'>Manufacturer</option><option value='Version2'>Version</option><option value='NULL2'>NULL</option><option value='Ignore2'>Ignore</option></select></td><td width=40% align=left> <select name="thirdDD3" style="display: none;" onchange="fillSelect(this,categories[this.value],'thirdDD4')"><option selected>Please Choose</option><option value='DeviceID3'>DeviceID</option><option value='Product3'>Product</option><option value='Manufacturer3'>Manufacturer</option><option value='Version3'>Version</option><option value='NULL3'>NULL</option><option value='Ignore3'>Ignore</option></select></td></tr></table><table width=100% border=0><tr width=25% align=right><td><input type='text' id='Version Number' value='Version Number' DISABLED='disabled' style='background-color:White; color:Black;'></td><td width=20% align=left> <---- Matches to -----> <select name="dropdown4" onchange="fillSelect(this,categories[this.value],'dropdown5')"><option selected>Please Choose</option><option value='DeviceID'>DeviceID</option><option value='Product'>Product</option><option value='Manufacturer'>Manufacturer</option><option value='Version'>Version</option><option value='NULL'>NULL</option><option value='Ignore'>Ignore</option></select></td><td width=15% align=left> <select name="secondDD4" style="display: none;" onchange="fillSelect(this,categories[this.value],'secondDD5')"><option selected>Please Choose</option><option value='DeviceID2'>DeviceID</option><option value='Product2'>Product</option><option value='Manufacturer2'>Manufacturer</option><option value='Version2'>Version</option><option value='NULL2'>NULL</option><option value='Ignore2'>Ignore</option></select></td><td width=40% align=left> <select name="thirdDD4" style="display: none;" onchange="fillSelect(this,categories[this.value],'thirdDD5')"><option selected>Please Choose</option><option value='DeviceID3'>DeviceID</option><option value='Product3'>Product</option><option value='Manufacturer3'>Manufacturer</option><option value='Version3'>Version</option><option value='NULL3'>NULL</option><option value='Ignore3'>Ignore</option></select></td></tr></table><table width=100% border=0><tr width=25% align=right><td><input type='text' id='Invoice Number' value='Invoice Number' DISABLED='disabled' style='background-color:White; color:Black;'></td><td width=20% align=left> <---- Matches to -----> <select name="dropdown5" onchange="fillSelect(this,categories[this.value],'dropdown6')"><option selected>Please Choose</option><option value='DeviceID'>DeviceID</option><option value='Product'>Product</option><option value='Manufacturer'>Manufacturer</option><option value='Version'>Version</option><option value='NULL'>NULL</option><option value='Ignore'>Ignore</option></select></td><td width=15% align=left> <select name="secondDD5" style="display: none;" onchange="fillSelect(this,categories[this.value],'secondDD6')"><option selected>Please Choose</option><option value='DeviceID2'>DeviceID</option><option value='Product2'>Product</option><option value='Manufacturer2'>Manufacturer</option><option value='Version2'>Version</option><option value='NULL2'>NULL</option><option value='Ignore2'>Ignore</option></select></td><td width=40% align=left> <select name="thirdDD5" style="display: none;" onchange="fillSelect(this,categories[this.value],'thirdDD6')"><option selected>Please Choose</option><option value='DeviceID3'>DeviceID</option><option value='Product3'>Product</option><option value='Manufacturer3'>Manufacturer</option><option value='Version3'>Version</option><option value='NULL3'>NULL</option><option value='Ignore3'>Ignore</option></select></td></tr></table><table width=100% border=0><tr width=25% align=right><td><input type='text' id='Supplier' value='Supplier' DISABLED='disabled' style='background-color:White; color:Black;'></td><td width=20% align=left> <---- Matches to -----> <select name="dropdown6" onchange="fillSelect(this,categories[this.value],'dropdown7')"><option selected>Please Choose</option><option value='DeviceID'>DeviceID</option><option value='Product'>Product</option><option value='Manufacturer'>Manufacturer</option><option value='Version'>Version</option><option value='NULL'>NULL</option><option value='Ignore'>Ignore</option></select></td><td width=15% align=left> <select name="secondDD6" style="display: none;" onchange="fillSelect(this,categories[this.value],'secondDD7')"><option selected>Please Choose</option><option value='DeviceID2'>DeviceID</option><option value='Product2'>Product</option><option value='Manufacturer2'>Manufacturer</option><option value='Version2'>Version</option><option value='NULL2'>NULL</option><option value='Ignore2'>Ignore</option></select></td><td width=40% align=left> <select name="thirdDD6" style="display: none;" onchange="fillSelect(this,categories[this.value],'thirdDD7')"><option selected>Please Choose</option><option value='DeviceID3'>DeviceID</option><option value='Product3'>Product</option><option value='Manufacturer3'>Manufacturer</option><option value='Version3'>Version</option><option value='NULL3'>NULL</option><option value='Ignore3'>Ignore</option></select></td></tr></table><table width=100% border=0><tr width=25% align=right><td><input type='text' id='Purchasing Officer' value='Purchasing Officer' DISABLED='disabled' style='background-color:White; color:Black;'></td><td width=20% align=left> <---- Matches to -----> <select name="dropdown7" onchange="fillSelect(this,categories[this.value],'dropdown8')"><option selected>Please Choose</option><option value='DeviceID'>DeviceID</option><option value='Product'>Product</option><option value='Manufacturer'>Manufacturer</option><option value='Version'>Version</option><option value='NULL'>NULL</option><option value='Ignore'>Ignore</option></select></td><td width=15% align=left> <select name="secondDD7" style="display: none;" onchange="fillSelect(this,categories[this.value],'secondDD8')"><option selected>Please Choose</option><option value='DeviceID2'>DeviceID</option><option value='Product2'>Product</option><option value='Manufacturer2'>Manufacturer</option><option value='Version2'>Version</option><option value='NULL2'>NULL</option><option value='Ignore2'>Ignore</option></select></td><td width=40% align=left> <select name="thirdDD7" style="display: none;" onchange="fillSelect(this,categories[this.value],'thirdDD8')"><option selected>Please Choose</option><option value='DeviceID3'>DeviceID</option><option value='Product3'>Product</option><option value='Manufacturer3'>Manufacturer</option><option value='Version3'>Version</option><option value='NULL3'>NULL</option><option value='Ignore3'>Ignore</option></select></td></tr></table><br /><table width="100%" border="0">
<tr>
<td width=25% align=center> </td>
<td width=25% align=center> </td>
<td width=25% align=left><input name="Clean" align="center" type="submit" value="Cleanse"/></td>
<td width=25% align=center> </td>
</tr>
</table>
</form>
</body>
</html>
Link to comment
Share on other sites

Here is a link to the jQuery JavaScript style documentation: http://contribute.jquery.org/style-guide/js/

 

I suggest you take a look at it there.

 

Use the tabulator key to properly indent your text.

<html>
	<head />
	<body />
</html>

Above is properly indented text (even though it's broken down to the most simple HTML document possible.

Below is not properly indented text and it is much harder to read than the above.

<html><head /><body /></html>

Hope that this gives you an idea how to format your code so that people reading the code (us, in this context), don't have to decipher that massive block of code.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.