...

View Full Version : Change Select Field



cheechm
09-26-2008, 11:24 PM
Hey,
I have this:


<table cellspacing="20">
<tr><th>Page</th><th>View</th><th>Change</th></tr>

<tr><td>Home</td><td><select name="1 view"><option value="1" SELECTED>Can view</option><option value="0">Can't view</option></select></td><td><td><select name="1 change"><option value="1" SELECTED>Can change</option><option value="0" >Can't change</option></select></td></tr><tr><td>Hire System</td><td><select name="2 view"><option value="1" SELECTED>Can view</option><option value="0">Can't view</option></select></td><td><td><select name="2 change"><option value="1" SELECTED>Can change</option><option value="0" >Can't change</option></select></td></tr><tr><td>Hire Catalogue</td><td><select name="4 view"><option value="1" SELECTED>Can view</option><option value="0">Can't view</option></select></td><td><td><select name="4 change"><option value="1" SELECTED>Can change</option><option value="0" >Can't change</option></select></td></tr><tr><td>Main Settings</td><td><select name="5 view"><option value="1" SELECTED>Can view</option><option value="0">Can't view</option></select></td><td><td><select name="5 change"><option value="1" SELECTED>Can change</option><option value="0" >Can't change</option></select></td></tr><tr><td>Customers</td><td><select name="6 view"><option value="1" SELECTED>Can view</option><option value="0">Can't view</option></select></td><td><td><select name="6 change"><option value="1" SELECTED>Can change</option><option value="0" >Can't change</option></select></td></tr><tr><td>Add Settings</td><td><select name="7 view"><option value="1" SELECTED>Can view</option><option value="0">Can't view</option></select></td><td><td><select name="7 change"><option value="1" SELECTED>Can change</option><option value="0" >Can't change</option></select></td></tr><tr><td>Parcel Services</td><td><select name="8 view"><option value="1" SELECTED>Can view</option><option value="0">Can't view</option></select></td><td><td><select name="8 change"><option value="1" SELECTED>Can change</option><option value="0" >Can't change</option></select></td></tr><tr><td>Authentication</td><td><select name="9 view"><option value="1" SELECTED>Can view</option><option value="0">Can't view</option></select></td><td><td><select name="9 change"><option value="1" SELECTED>Can change</option><option value="0" SELECTED>Can't change</option></select></td></tr></table>

How would I make is that when a for eg, 1 view = 0, 1 change is made to equal zero as well?

Thanks

jmrker
09-27-2008, 03:57 AM
Can you explain what you want to do a little more?

Also, it is a little easier to view if you put the script between
[ php] and [ / php] tags (without the spaces), like this:


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

<table cellspacing="20">
<tr>
<th>Page</th>
<th>View</th>
<th>Change</th>
</tr>

<tr>
<td>Home</td>
<td><select name="1 view">
<option value="1" SELECTED>Can view</option>
<option value="0">Can't view</option>
</select></td>

<td>
<td><select name="1 change">
<option value="1" SELECTED>Can change</option>
<option value="0" >Can't change</option>
</select></td>
</tr>

<tr>
<td>Hire System</td>
<td><select name="2 view">
<option value="1" SELECTED>Can view</option>
<option value="0">Can't view</option>
</select>
</td>

<td>
<td><select name="2 change">
<option value="1" SELECTED>Can change</option>
<option value="0" >Can't change</option>
</select>
</td>
</tr>

<tr>
<td>Hire Catalogue</td>
<td><select name="4 view">
<option value="1" SELECTED>Can view</option>
<option value="0">Can't view</option>
</select>
</td>

<td>
<td><select name="4 change">
<option value="1" SELECTED>Can change</option>
<option value="0" >Can't change</option>
</select>
</td>
</tr>

<tr>
<td>Main Settings</td>
<td><select name="5 view">
<option value="1" SELECTED>Can view</option>
<option value="0">Can't view</option>
</select>
</td>

<td>
<td><select name="5 change">
<option value="1" SELECTED>Can change</option>
<option value="0" >Can't change</option>
</select>
</td>
</tr>

<tr>
<td>Customers</td>
<td><select name="6 view">
<option value="1" SELECTED>Can view</option>
<option value="0">Can't view</option>
</select>
</td>

<td>
<td><select name="6 change"><option value="1" SELECTED>Can change</option>
<option value="0" >Can't change</option>
</select>
</td>
</tr>

<tr>
<td>Add Settings</td>
<td><select name="7 view">
<option value="1" SELECTED>Can view</option>
<option value="0">Can't view</option>
</select>
</td>

<td><td><select name="7 change">
<option value="1" SELECTED>Can change</option>
<option value="0" >Can't change</option>
</select>
</td>
</tr>

<tr>
<td>Parcel Services</td>
<td><select name="8 view">
<option value="1" SELECTED>Can view</option>
<option value="0">Can't view</option>
</select>
</td>

<td>
<td><select name="8 change">
<option value="1" SELECTED>Can change</option>
<option value="0" >Can't change</option>
</select>
</td>
</tr>

<tr>
<td>Authentication</td>
<td><select name="9 view">
<option value="1" SELECTED>Can view</option>
<option value="0">Can't view</option>
</select>
</td>

<td>
<td><select name="9 change">
<option value="1" SELECTED>Can change</option>
<option value="0" SELECTED>Can't change</option>
</select>
</td>
</tr>
</table>

</body>
</html>

Note also in you code you have a lot of unmatched <td></td> pairs
and in the select name="9 change" (and the others)
you should not have a space in the name
nor should it start with a number (use name='change9' instead).
and you have both options SELECTED.

Finally, what is you JS question? I only see HTML code here.

cheechm
09-30-2008, 05:04 PM
Thanks! So lets start here:



<tr>
<td>Parcel Services</td>
<td><select name="view8">
<option value="1" SELECTED>Can view</option>
<option value="0">Can't view</option>
</select>
</td>

<td>
<td><select name="change8">
<option value="1" SELECTED>Can change</option>
<option value="0" >Can't change</option>
</select>
</td>
</tr>

So when view8 == 0, I want change8 to == 0 was well, on the fly.

Thanks

cheechm
10-02-2008, 11:02 PM
Bump :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum