• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 127
  • Last Modified:

Dynamic Form to Mail

I'm trying to build a dynamic form that allows users to choose spare parts (and quantities of) for a variety of products.

Depending on the product chosen, the form displays the name and a quantity box for each spare part that's available. The quantity box is dynamically named, so that I can pass the data using the #FORM.fieldnames# method.

Unfortunately, the actual spare part numbers & names all contain hyphens or spaces so I'm running into problems with passing the data.

I'm now working on an approach to assign a temporary identifier to pass the data and then convert it back to show the real values to the supplier when they receive their email. Needless to say I'm having difficulty with this.

This is not for a shopping cart. It's function is simply to send an email requesting a quote from the supplier.

Hope you can help. Thanks in advance.
  • 2
1 Solution
Use an id or standard value for the quantity box and then pass the actual spare part name in a hidden field.

You shoudn't try to use regular names as ColdFusion variables.

<input type=text name=part#part_id#_quantity value=0>
<input type=hidden name=part#part_id#_name value="#part_name#">
based on ur requirement given above.

it majorly depends how u structure ur HTML to eb able to form the form_fields

u cld use LOOPS basically [but i dont know if u ahve the otion to run them - if not u'll need to change it to form them & read them] this is how u do it

<cfloop index="i">
   <input name="qty#i#">
   <input name="Spares#i#">

& while reading them - u'll need to use another loop

<CFLOOP index="j">

this can be of gr8 help if u ahve ur form design lke i have suggested above [i genrally use this]

but if r working differently - then pls let me know ur format - so i can decide & help u on that accordingly :)

NetSmithAuthor Commented:
Thanks for the help. I went down a different road in the end, using Structures, but the advice was good - thanks again.

yeah structures is also a neat way to go ...

but ive always prefered using list & love playing with them ... so ... :)

thanx for the points thou


Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now