pk wrote:
Let me start off by mentioning that I'm not a web developer by any
means. I welcome any and all tips regarding code cleanliness and would
love to hear about any conventions that I'm breaking.
a form can't be in a table
a form can be in a cell
a form can contain a table
does a form can be in an other form ?
I have a page here that I've broken down to its simplest (that i know
of) elements so it is easier for you guys to follow along.
http://www.bigkaiser.com/phil/test.html
If you look closely, you'll see that I have an instance of nested
forms. I don't know how to get around this. The reason for this is
that I need the form that is nested inside, "myform", controls a
dynamic element in the greater form "kpt".
form 'myform' has any action
why selects (hidden and visible) can't be in main form kpt ?
When one chooses "Rough"
from the "Boring Type:" selection dropdown, another dropdown appears
below. I don't know how to get this behavior without creating a form.
I need the "kpt" form because it ultimately sends information to my SQL
Server backend and returns the query results. (This part was working
before I added the interior form.)
What secondary select send, your SQL query must analyse it
Do your query relatively to those results
Why to not only use 'kpt' ?
<form action="insertselector.php" name="kpt" method="post"
target="stkdata" style="font-family:comic sans ms; color:#000;>
<table border="1" width="615">
<tr>
<td style="text-align:right" width=117>Boring Type:</td>
<td><select name="Finish"
onchange="var k = this.selectedIndex;
if(k==1) {
document.getElementById('BalStepDiv1').style.displ ay = 'inline';
}
else {
BalStepVal.selectedIndex = 0;
document.getElementById('BalStepDiv1').style.displ ay = '';
}
">
<option></option> <option>Rough</option>
<option>Finish</option>
</select>
<span id="BalStepDiv1" style="display:none;color:red">
Balance or Step :
<select name="BalStepVal">
<option></option>
<option>Balanced Cutting</option>
<option>Step Cutting</option> </select>
</span>
</td>
</tr>
<tr><td>...</td><td> ... </td></tr>
</table>
if 'Rough' is chosen
span 'BalStepDiv1' is displayed :
- text (balance)
AND
- select 'BalStepVal'
are shown
if not 'Rough' is not chosen,
- span 'BalStepDiv1' is none displayed : (text and select disappear)
- options of BalStepVal are set to first one (no text, no value)
your sql query must do something with this '0' or ''
or must not ? as you like.
Absolutly no need all those divs
while you use a table to arrange your elements
Absolutly no need all those font="face color ..." once is enough
use style insteed
--
Stephane Moriaux et son [moins] vieux Mac