Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hidden Radio Buttons? This post is kind'a lengthy.

Status
Not open for further replies.

macr0

Programmer
Jan 29, 2000
31
US
Is there anyway to simulate hidden radio buttons? Here is my delima.<br>
<br>
I have a site administration page with all of the memebers listed. There are 2 security levels that a memeber can have, 1 and 2. If it is 1, then the member is an administrator. If 2, only a member(not access to changing anything). <br>
On the Administration page, (with all user info displayed) I want people with Security Level 1 to be able to edit thing, but I do Not want them to be able to edit the site administrators personal info(&quot;me&quot;). I want this code to be portable so I don't want to make a static variable for my username.<br>
<br>
Now, I create a Session variable on login if the user is a site administrator (1 if is, 0 if not). This is the check for people with security Level 1 (if they can edit the site administrator's info&lt;ME&gt;). (all of this works fine)<br>
<br>
Here is the problem. I use a DataBase query and a getrows array to display all of the users, and their info. If the user is to be Edited, a radio has to be checked and an Edit Submit button pressed. The string is passed in &quot;Get&quot; style (i.e. UserName=Bob&PWD=candy&SecurityLevel=1)( radio is set by the loop using info from the array).<br>
<br>
the Form is self processed to the same page (at the top is a form submit check for redirection to the edit page). How can I send a value through the form process if the user to be edited is a site administrator. I can set a variable that determines whether or not the user is a siteadministrator (DB field for it) but I do not know a way to pass it, except through the &quot;get&quot; method&lt;which I could just tag onto the end of the radio button string&gt; (and it would be stupid to do with, they could just change the URL and bypassit). So, the only other way I can figure out anything is to somehow make a hidden &quot;radio&quot; button next to the visible one &quot;if a site admin, yes, otherwise no&quot; so I can check using Request.Form(&quot;blah&quot;). Since the page is generated on the fly by a loop, the problem arises.<br>
<br>
My idea to fix this is..<br>
<br>
make unique hidden form inputs for each user and set them to &quot;siteadministrator&quot; or &quot;not&quot; and then have a loop in the &quot;if&quot; statement at the top to somehow run through all of the hidden fields, find the &quot;siteadministrator&quot; and check to see if it matches the current record to be edited.(not very efficient, probably have to requery the database) I have tried different ways to do this, but I am TOTALLY stumped. Then again, I may not be using the correct approach.<br>
<br>
Any suggestions? better way to do this?<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top