Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8958465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:13:10+00:00 2026-06-15T15:13:10+00:00

( Edit : This is a follow-up to a previous question ) I’m working

  • 0

(Edit: This is a follow-up to a previous question)

I’m working on complete redesign of a site that allows users to check out multiple machines for multiple users.

Here’s what I have so far.

A front page that outputs two cfqueries.

One query is the active machines (ie, already checked out) It’s a basic cfoutput query and displays the info based on the values of the query. I use a cfif statement to filter only the active machines (value = 1 if active in SQL)

It also outputs stuff like MAC, IP OS etc.

The other query is the inactive machines that a user can check out. It is also filtered based on whether it is active, this time by cfif query.active eq 0. This query has a few form fields so that the user can check the check boxes of devices to check in, enter in the require fields (userID and comments, basically) and submit it.

There is a dropdown menu at the bottom of this page that allows you to select the action, and the form passes in an action number (form.choose_action) that tells the cfc what it should do. IE if the action number is 4, that tells the cfc to send the person to the edit page and passes the deviceID along with it.

So basically I’m passing in the DeviceID in every situation, and the UserID only if the machine is active.

When the user clicks submit, it goes straight to a page which calls a cfc that does most of the heavy lifting.

All in all, this is an extremely poor solution, as it only really works well when one machine is being checked in or out at a time.

Here’s a picture to better explain what’s going on.

example

Here’s what I would like:

Multiple devices can be selected and be checked in/checked out, hopefully using checkboxes in some way.

If checking a machine out for a user, UserIDs have to be somehow attached to the respective devices in the entry form (the inactive output query) and should be entered along with the deviceID in a single insert, if possible.

I want to be able to check in multiple devices, but also stop people from checking out machines that are active (as they are already checked out). Same goes for inactive machines, I would like to stop a user from checking in a machine that has yet to be checked out. As of now I’m just using number (ie if field is greater than 0 )

Some notes: Only one user is going to be using this at a time, so I don’t have to worry about session stuff or having lots of people trying to check in the same device.

At the moment I currently push variables to a page which then passes the form data into a CFC, this might not be the best way to do it.

Really the big problem I’m having is from a design standpoint, my logic is very convoluted and inefficient. At the moment the only thing I could think of is passing the device values in through an array. But not sure if I could do this in a checkbox.

Thank you for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:13:11+00:00Added an answer on June 15, 2026 at 3:13 pm

    Since the devices may be assigned to different users, you need a naming convention that will allow you to associate each deviceID with its related fields ie userID, comments, etcetera. One option is to add the “deviceID” as a suffix to each set of fields:

      <cfoutput query="yourQuery">
          Device ID <input type="checkbox" name="deviceID" value="#deviceID#">
          UserID:<input type="text" name="userID_#deviceID#" ...>
          Comment:<input type="text" name="comment_#deviceID#" ...>
      </cfoutput>
    

    Say your query contained three device id’s ie 35,48,52 the resulting field names would look like this. Notice each set of fields shares the same device id.

     <input type="checkbox" name="deviceID" value="35">
     <input type="text" name="userID_35" ...>
     <input type="text" name="comment_35" ...>
    
     <input type="checkbox" name="deviceID" value="48">
     <input type="text" name="userID_48" ...>
     <input type="text" name="comment_48" ...>
    
     <input type="checkbox" name="deviceID" value="52">
     <input type="text" name="userID_52" ...>
     <input type="text" name="comment_52" ...>
    

    Then when the form is submitted, form.deviceID will contain a comma delimited list of the checked devices. You can loop through that list and use the current ID to grab the associated userID and comment values. Once you have those values, use the action type to run an INSERT, UPDATE or whatever you need to do.

    Note, again since each device may be assigned to a different user, you cannot do the INSERT in a single statement

      <cfparam value="form.deviceID" default="">
    
      <!--- for each device id .. --->
      <cfloop list="#form.deviceID#" index="currDeviceID">
    
          <!--- grab the associated user and comment --->
          <cfset userID = FORM["userID_"& currDeviceID]>
          <cfset comment = FORM["comment_"& currDeviceID]>
    
          ... validate ...
    
          <cfquery ...>
               run your query
          </cfquery>
    
      </cfloop>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a follow up to a previous question that I had before about
This is a follow-up question to my previous question on Managing employee contracts in
This is a follow up question to my previous question . I am trying
That's a question really similar to this previous post of mine. I need to
This is a follow-up to my previous question. I've simplified things as much as
This is a follow up to my previous AngularJS question . I am trying
This is a follow up to my previous question . I need to place
This is a follow-up question to my previous one . Situation: Table 1: +--------------------+--------------------+
This is sort of a follow up to a previous question, but I'll repost
this is a follow up question from my previous one. you can find it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.