I have a form that I use to put servers in what we call maintenance mode. It's just a (dynamic) list of servers that the user will toggle a checkbox to put the respective server in maintenance mode. I'm using the objid (serverid) as the checkbox value, checking for null, and if not, then set the maintenance mode. However, I'm not passing anything at all. Below is my form and ASP code:
Thanks for your input Old Pedant. Let me start over. Here's the form data I'm trying to capture. I have a list of servers that I want to either put into or take out of maintenance mode, based on their checkbox selection. (See image)
I'm not sure how to capture the serverid when the form is submitted. I thought I could use the serverid as the value object but no luck.
I would rather have seen the HTML instead of the screen shot.
You do that by bringing up the page in your browser, clicking on the VIEW menu of the browser, then the SOURCE or PAGE SOURCE menu item. That shows you the HTML as the browser sees it. Copy/paste the relevant code from that.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
First of all, I *KNOW* that is *NOT* really your code.
You don't have the beginning of the loop shown, you don't show where objid comes from (probably from objid = rsqdb("some field name" but you don't show that).
And the HTML isn't even legal HTML. (A missing <tr> if nothing else.)
But that isn't why I wanted to see the HTML AND NOT THE ASP code. I wanted to see the KINDS of values that will be *IN* those checkbox values. Yes, it's important.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Last edited by Old Pedant; 11-07-2012 at 01:04 AM..
Also, is there some reason you are using method="get" in your <form> tag instead of method="post"?
And is this page private to your company? That is, is the page accessible on the internet or is it strictly an inTRAnet page? If it is on the inTERnet, is it password protected?
FWIW, *IF* all my suspicions are correct, I *THINK* you will be able to simply do this on your updatemm_select.asp page to make it change *ALL* of the checked items to maintenance mode:
Code:
<%
set Conn=Server.CreateObject("ADODB.Connection")
Conn.open "Provider=sqloledb;Server=server;Initial Catalog=db;UID=user;PWD=pw;"
sql = "UPDATE object SET status = 'maintenance' WHERE objid IN (" & Request("toggle_maint") & ")"
howmany = 0
conn.Execute sql, howmany
Response.Write "Changed " & howmany & " to maintenance mode"
conn.Close
%>
(The actual value you set status to of course depends on your needs, but that's the general idea.)
If you want, you can just try that code to see if it works.
But if it doesn't work, then I need all that I have asked for from you.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.