Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Checkboxes and parsing out numbers

Posted on 2003-11-09
3
Medium Priority
?
216 Views
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">
<TR>
<TD CLASS="formtext">
      <CFOUTPUT>Remove staff from #AdminDetails.AdminPositionName#</CFOUTPUT>
      <INPUT TYPE="HIDDEN" NAME="StepTwo" VALUE="Yes">
</TD>
</TR>
<TR>
<TD>Select the staff to remove:</TD>
</TR>
<CFOUTPUT QUERY="AdminDetails" GROUP="AdminPositionID">
  <!--- find staff details for this iteration --->
  <CFQUERY NAME="GetStaffDetails" DATASOURCE="#DataSource#">
      SELECT Staffing.FirstName,
               Staffing.LastName
      FROM Staffing
      WHERE Staffing.StaffID = #AdminDetails.StaffID#
  </CFQUERY>
  <TR>
      <TD> &nbsp;
      <INPUT TYPE="CHECKBOX" NAME="#StaffingInAdminID#" VALUE="Yes">
      GetStaffDetails.FirstName# #GetStaffDetails.LastName#&nbsp;&nbsp;Loading <i>    #AdminDetails.LoadingInPosition#</i>
      </TD>
  </TR>
</CFOUTPUT>
<TR>
<TD><INPUT TYPE="SUBMIT" VALUE="Remove Staff Member(s)"></TD>
</TR>
</FORM>

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

CB Firstname lastname loading: 1
CB firstname lastname loading: 1
....etc

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
FORM.24
FORM.57
FORM.31
etc

maybe this would be easier if i used:
<INPUT TYPE="CHECKBOX" NAME="Staffing#StaffingInAdminID#" VALUE="Yes">
so it would return
FORM.Staffing24
FORM.Staffing57
FORM.Staffing31
etc
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,
Brad
0
Comment
Question by:bradderick
3 Comments
 
LVL 10

Accepted Solution

by:
Mause earned 2000 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
Mause
0
 
LVL 11

Expert Comment

by:hart
ID: 9712999
Bingo Mause :-)

Regards
Hart
0
 

Author Comment

by:bradderick
ID: 9719430
Thanks Mause that worked perfectly!

Cheers,
Brad
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month6 days, 12 hours left to enroll

782 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