Then surely you could publish just the <form> HTML here, or somewhere on
a public server - while snipping any "secret" parts.
OK - see below - at the bottom.
..which might work if JavaScript is not disabled. Can you be sure?
Yes - I'm using a lot of JS in this user interface. The pages are used
only on a LAN and only by a few people. Having JS enabled is a
requirement.
First, I'd be curious what kind of data you expect these buttons to
store in your database. Are they:
<input type="button" name="button1" value="1234"> or
<button type="button">Display This Text</button>
I'm using: said:
<button> usually means 'do an immediate action' while the form is still
running, and there'll be no value to store in the action script.
Since you imply multiple buttons, I'm assuming these are not "submit"
buttons. <input type="submit" ...>
That is correct - they are not "submit" buttons. There is only one of
those.
The purpose of the input buttons is to enable the user to control the
ON/OFF status of a certain feature. Clicking the button changes the
button's color and wording (and also changes its value). When the user
clicks the submit button, the status of the buttons is sent to the
server where it is extracted and used to update some real-world
statuses.
===============================================
There are actually 9 rows in the table below - I've included only the
first 3 here to simplify things a bit.
--------------------------------------------------------------------------------------
Here is the function (in the head of the page) that updates the
buttons appearance and sets the value in the hidden input that I'm
currently using.
<script type='text/javascript'>
function toggleState(item){
x='ONOFF'+item.name.substring(3);
document.getElementById('test').value=x;
if(item.className == 'on') {
item.className='off';
item.value=' OFF ';
document.getElementById(x).value='OFF';
} else {
item.className='on';
item.value=' ON ';
document.getElementById(x).value='ON';
}
}
</script>
</head>
<BODY background='/WebGraphics/background.gif' onload='init();'>
<a name='pagetop'> </a>
<FORM action='RepackSorter.htm' method='post'>
<table width='850px' bgcolor='#f5f5f5' BORDER=1 align='center'
cellpadding=1>
<colgroup><col width='10%' align='center'><col width='10%'
align='center'><col width='10%' align='center'><col width='10%'
align='center'><col width='10%' align='center'><col width='10%'
align='center'><col width='10%' align='center'><col width='10%'
align='center'></colgroup>
<tr><td colspan='8'>REPACK SORTER</td></tr>
<tr><b><td>Divert #</td>
<td>Lane</td>
<td>Status</td>
<td>Mode</td>
<td>Priority</td>
<td>Carrier</td>
<td>Truck</td>
<td>Retail</td>
</b></tr>
<tr><td>1</td>
<td>Table 1</td>
<td>UNKNOWN</td>
<td><INPUT type='hidden' value = 'OFF' name='ONOFF1'><input
type='button' name='btn1' value='OFF' class='off'
onclick='toggleState(this)'></td>
<td>1</td>
<td> </td>
<td>5</td>
</tr>
<tr><td>2</td>
<td>Table 2</td>
<td>UNKNOWN</td>
<td><INPUT type='hidden' value = 'OFF' name='ONOFF2'><input
type='button' name='btn2' value='OFF' class='off'
onclick='toggleState(this)'></td>
<td>2</td>
<td>FEDEX</td>
<td> </td>
</tr>
<tr><td>3</td>
<td>Table 3</td>
<td>UNKNOWN</td>
<td><INPUT type='hidden' value = 'OFF' name='ONOFF3'><input
type='button' name='btn3' value='OFF' class='off'
onclick='toggleState(this)'></td>
<td>3</td>
<td>UPS</td>
<td> </td>
</tr>
</table>
<br /><p align='center'><INPUT type='submit' tabindex='40' value='Save
Changes' name='UPDATE' style='font-weight:bold; text-align:center;
background-color:#C0FFC0; width:177px;'></p>
</FORM>
</body>
</html>