Checkboxes and parsing out numbers

Posted on 2003-11-09
Last Modified: 2013-12-24
Hi All,

Well i'm struggling a bit with a reasonably simple form submission problem and was wondering if anyone had some ideas for me.

Here's the code:

<FORM NAME="StepTwoRemove" ACTION="editproc.cfm" METHOD="POST">
<TD CLASS="formtext">
      <CFOUTPUT>Remove staff from #AdminDetails.AdminPositionName#</CFOUTPUT>
      <INPUT TYPE="HIDDEN" NAME="StepTwo" VALUE="Yes">
<TD>Select the staff to remove:</TD>
<CFOUTPUT QUERY="AdminDetails" GROUP="AdminPositionID">
  <!--- find staff details for this iteration --->
  <CFQUERY NAME="GetStaffDetails" DATASOURCE="#DataSource#">
      SELECT Staffing.FirstName,
      FROM Staffing
      WHERE Staffing.StaffID = #AdminDetails.StaffID#
      <TD> &nbsp;
      <INPUT TYPE="CHECKBOX" NAME="#StaffingInAdminID#" VALUE="Yes">
      GetStaffDetails.FirstName# #GetStaffDetails.LastName#&nbsp;&nbsp;Loading <i>    #AdminDetails.LoadingInPosition#</i>
<TD><INPUT TYPE="SUBMIT" VALUE="Remove Staff Member(s)"></TD>

So when this loads it loads a list like the following:

CB Firstname lastname loading: 1
CB firstname lastname loading: 1

When this submits i want to then remove the staff who have been checked, meaning the StaffingInAdminID checkboxes would be defined.

The problem i'm struggling with is as it is dynamic, i don't know how to work out how to find what was returned in the FORM structure...
as this will return

maybe this would be easier if i used:
<INPUT TYPE="CHECKBOX" NAME="Staffing#StaffingInAdminID#" VALUE="Yes">
so it would return
and then just parse off the end number?

I'm not sure, maybe im missing something blatantly obvious here but i think i am getting brain freeze :o)

Thanks for your time,
Question by:bradderick
LVL 10

Accepted Solution

Mause earned 500 total points
ID: 9712842
just make a checkbox like this:

<INPUT TYPE="CHECKBOX" NAME="Staffing" VALUE="#StaffingInAdminID#">

so the value is the id of the record.

In the action page there is a list called "staffing" width al ID that you have checked in the form.
(form.staffing = ''24,57,31")
If there is no variable "staffing" there are no checkbox checked.

hope this helps, let me know
LVL 11

Expert Comment

ID: 9712999
Bingo Mause :-)


Author Comment

ID: 9719430
Thanks Mause that worked perfectly!


Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now