Posts | Comments

Archive for July, 2007

So I’m continuing the problem of my coldfusion array building.

What I’ve got is a series of checkboxes in a form. What I need to do is take any checked (or ‘on’) items and create a comma-sep list of the names of the variables.

I attempted to use an if(isdefined…){ add to an array } but it’s not working as planned. Here’s the code I’m using:

  1. checkedItems = ArrayNew(1);     if(isdefined("form.heat1")){
  2.  
  3. checkedItems[1] = "heat1";
  4.  
  5. }
  6.  
  7. if(isdefined("form.heat2")){
  8.  
  9. checkedItems[2] = "heat2";
  10.  
  11. }
  12.  
  13. if(isdefined("form.heat3")){
  14.  
  15. checkedItems[3] = "heat3";
  16.  
  17. }
  18.  
  19. if(isdefined("form.tied")){
  20.  
  21. checkedItems[4] = "tied";
  22.  
  23. }
  24.  
  25. if(isdefined("form.notcontested")){
  26.  
  27. checkedItems[5] = "notcontested";
  28.  
  29. }
  30.  
  31. if(isdefined("form.handtimed")){
  32.  
  33. checkedItems[6] = "handtimed";
  34.  
  35. }
  36.  
  37. if(isdefined("form.preliminaries")){
  38.  
  39. checkedItems[7] = "preliminaries";
  40.  
  41. }
  42.  
  43. if(isdefined("form.meetrecord")){
  44.  
  45. checkedItems[8] = "meetrecord";
  46.  
  47. }
  48.  
  49. if(isdefined("form.schoolrecord")){
  50.  
  51. checkedItems[9] = "schoolrecord";
  52.  
  53. }
  54.  
  55. if(isdefined("form.staterecord")){
  56.  
  57. checkedItems[10] = "staterecord";
  58.  
  59. }

The problem is, when I run through that if list, I end up with #1 as ‘heat1′ and #6 as ‘handtimed’ and 2-5 will be “[undefined array element].”

Justine recently got some slides converted to CD of her as a child - simply amazing photos (which I’ve taken the liberty to upload to Flickr - friends and family only).
The one with her wearing fake doctor glasses looking up just kills me - it’s the same look I’ve seen a thousand times on late nights while she’s cutting paper, or assembling a package, or working on a design.
0032215-R1-E001.jpg

So I’m working on updating a page (something I thought I had already completed) to a more “traditional” html style. By “traditional” I mean a simple form with an insert that fired a form method of POST.

The problems I’m having involve the form submission. Here’s a rundown:

A view of my form

When submitting the form, I need the variables to be added to a STRUCT type so the new STRUCT can be sent to a ColdFusion Component function (which then picks up the struct and submits the data to a stored procedure). Upon successful submission, the component will return a ’success’ message (containing the newly inserted rows ID), and on error will display the proper error message.

So here’s what’s up:

  1. I cannot populate the STRUCT correctly because some of the form field variables may be null (meaning no entry was selected). Checkboxes, selects, multiselects, and text fields.
  2. With the checkboxes, I need to create an array of anything that’s been selected. Here’s the variable names for the checkboxes:
    1. heat1
    2. heat2
    3. heat3
    4. tied
    5. notcontested
    6. handtimed
    7. preliminaries
    8. meetrecord
    9. schoolrecord
    10. staterecord

I’ve been told to look into using ISDEFINED and STRUCTKEYEXISTS.

Any thoughts, insight?

Getting Hitched

In case you didn’t know yet, Justine Corcorran and I are getting married on August 4, 2007 in Blaine, Washington.

Neither of us has talked much about the wedding on our own blogs, and I guess it’s high-time for me to start (considering I’m sitting on the front porch of her parent’s house, while inside and on the back yard Justine’s bridal shower is going off). That, and there’s only 28 days remaining until the big day.

Am I nervous? Have I only slept an hour or two a night? Am I constantly popping ibuprofin and using a hot towel to soothe my sore jawbone from clenching my teeth so much lately? Yes to all would be appropriate.

Of course I’m nervous, anxious, worried about the planning coming together, money, work, the fact that I’m about to get married and will be with this one woman, side by side, better or worse, for the rest of our lives. At the same time I’m very excited. I can’t wait to share with the world the new wonder-duo that we are. We are an amazing team that has proven over the years to be damn-near indestructible.

Over the next three weeks I’ll do my best to keep an updated log of activities, feelings, and the buildup to our wedding.

(more…)

chadedge dot-com is powered by WordPress. Design by Nofie Iman.