Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Sets Value to Pass before Dynamic Select

Status
Not open for further replies.

nadamson

IS-IT--Management
Dec 26, 2004
50
GB
Hi,

I'm new(ish) to CF, but was a programmer 15 years ago (in a dos enviroment) so its all slowly coming back to me.

The problem I have is that I want to select a record from a dynamic list and pass it to the next page, I set the parameters to pass in the form but the parameters are being set before I make my selection from the dynamic list when the form is a POST, if I change the form to a GET the parameters are not passed.

I see from this forum that one method is to use Javascript to load the database contents into an array, but that seems to defeat the object of dynamic databases ???

Any advice ???

 
when you post your first form, you will need to use form scope to catch what the user selected from the list in the first page.

you can use

<cfdump var="#form#"> on the second page to see the variables.
hope it helps...

 
nadamson, lemme see if I understand what you're doing. On teh form, you query the dB and populate the select list with values. The user makes a selection (and presumably fills out other fields) and submits the form. On the process page, you are trying to capture the value of the selection from the drop-down and do something with it, right?

If my understanding is right, then what happens when you try to grab that value on the process page?

Unless you aren't using a drop-down box but are using checkboxes. If you're using checkboxes then any field that isn't checked will not be passed to the next page (thats an HTML property). To get around that, on the process page you'd need to use <cfparam name="" default=""> to "create" that field with the default value of null. So what this does is if the user does not click on any checkbox the checkbox name will still exist on teh process page but its value will be null.



____________________________________
Just Imagine.
 
OK.

1. You have a form. The form has fields and associated values. Your user makes choices about those values.
The user presses the "Submit" button. The values are passed to your action page.

2. Usually, at this point, you (the developer) employ the user's choices in a database action, whether to store the passed values, query the DB based on the values, whatever.

I'm not sure what you mean by

select a record from a dynamic list and pass it to the next page

How about you describe your application in terms of what I listed above, and show us a bit of code?



Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
I'll have the roast duck with the mango salsa.
 
And sorry for the simul-post, GUJUModel!

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
I'll have the roast duck with the mango salsa.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top