Re: Can I pass variable to a form on the same page?

2002-10-04 Thread charlie griefer

Mitko: 

You'll need some javascript to accomplish this.  In your form tag, add an 
onSubmit='doFunction()' 

in your doFunction function (and please, feel free to give it a less silly 
name), reference the form fields and change the action of the form. 

to reference the value of a select:
document.formName.selectName.options[document.formName.selectName.selectedIn 
dex].value 

to change the action:
document.formName.action = 'newActionPage.cfm'; 

at the end, submit it using:
document.formName.submit(); 

If you need clarification, contact me offlist and i'll get more specific 
with the code. 

charlie 

Mitko Gerensky-Greene writes: 

 Hello, 
 
 I have a page with a form with two drop down menus -- for state and fiscal year. I 
want the action (target) of the form to be a page whose directory is defined by the 
fiscal year selected and whose file name is defined by the state selected. 
 
 I.e. from select_plan.cfm (the page with the form) I want to be able to go to 
/fy2002/va.cfm if Fiscal Year 2002 and Virginia were selected from the menu options 
in the form. 
 
 I understand that I cannot have the following: 
 
 form action=file=/#fiscalyear#/#statecode#.cfm method=post name=info 
 
 where both fiscalyear and statecode are selected in this same form. 
 
 How can I implement this? 
 
 Thanks in advance, 
 
 Mitko
 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com



RE: Can I pass variable to a form on the same page?

2002-10-04 Thread Bryan Love

I highly recommend using CFINCLUDE in a situation like this.  It's much
simpler.

Have your form submit to some action page that simply does this:

CFINCLUDE template=../#form.fiscalyear#/#form.statecode#.cfm


+---+
Bryan Love
  Macromedia Certified Professional
  Internet Application Developer
  Database Analyst
TeleCommunication Systems
[EMAIL PROTECTED]
+---+

...'If there must be trouble, let it be in my day, that my child may have
peace'...
- Thomas Paine, The American Crisis

Let's Roll
- Todd Beamer, Flight 93



-Original Message-
From: Mitko Gerensky-Greene [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 04, 2002 9:56 AM
To: CF-Talk
Subject: Can I pass variable to a form on the same page?


Hello,

I have a page with a form with two drop down menus -- for state and fiscal
year. I want the action (target) of the form to be a page whose directory is
defined by the fiscal year selected and whose file name is defined by the
state selected.

I.e. from select_plan.cfm (the page with the form) I want to be able to go
to /fy2002/va.cfm if Fiscal Year 2002 and Virginia were selected from the
menu options in the form.

I understand that I cannot have the following:

form action=file=/#fiscalyear#/#statecode#.cfm method=post
name=info

where both fiscalyear and statecode are selected in this same form.

How can I implement this?

Thanks in advance,

Mitko

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm