Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / June 2008



Tip: Looking for answers? Try searching our database.

Problem submitting cfform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
haaazy - 25 Jun 2008 15:17 GMT
I have a cfform with a cftree in it:
cfform name="myform" format="HTML">
<cftree name = "LocationChooser"format="applet"
required = "no"
completePath = "no"
appendKey = "no"
highlightHref = "no"
lookAndFeel = "windows"
font = "Verdana"
fontSize = "10"  
italic = "no"  
bold = "no"  
height = "320"  
width = "200"  
vSpace = "10"  
hSpace = "10"  
align = "absmiddle"  
border = "yes"  
hScroll = "no"  
vScroll = "yes"    
notSupported = "Browser must support Java">
...some treeview code
</cftree>
</cfform>

I have two other normal html forms, here is one of them:
<form name="frmEngineerReport" method="post" action="rptWJBM_proc.cfm">

When I click the button to submit this form, I want to also submit the cfform.
I need to do this to get the full path of currently selected node on the
treeview.  I can't put the tree in the form, because like i said there are two
forms, and the treeview needed to get submited if either of them get submitted.
So I would have to have two treeviews to have one on each form, which is
unacceptable.  Thanks in advance for any help.
Azadi - 25 Jun 2008 17:05 GMT
can't you have ONE cfform, with cftree AND other form controls?
why do you have to have 2 forms?

which cf version are you on?

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
rhaazy - 25 Jun 2008 19:00 GMT
> can't you have ONE cfform, with cftree AND other form controls?
> why do you have to have 2 forms?
[quoted text clipped - 3 lines]
> Azadi Saryev
> Sabai-dee.comhttp://www.sabai-dee.com/

Problem is the variable I want, the path of the selected node does not
get created until the form it is on is submitted.  So I would have to
implement some form of submitting two forms.

I haven't been able to get this to work yet..
tried simple javascript:
onclick="dualSubmit(this.form)";

dualSubmit(frm1)
{
document.frm1.submit();
document.mycfform.submit();
}

But this doesn't appear to work, as my action page returns false for
this statement
isDefined(mycfform.submit)
GArlington - 26 Jun 2008 12:44 GMT
<snap>

> dualSubmit(frm1)
> {
[quoted text clipped - 6 lines]
> this statement
> isDefined(mycfform.submit)

I suspect that it does work (add some trace statements to your
processing form to check it yourself), the problem is that you are
sending TWO separate requests. CF still processes BOTH, but you get
the output from only one of them - MOST of the time it will be the
last request.
So, if you can not get around the need of two forms you will have to
invent a way of processing two separate requests and combining the
output in one response [session scope might help you here].
rhaazy - 26 Jun 2008 20:34 GMT
> <snap>
>
[quoted text clipped - 17 lines]
> invent a way of processing two separate requests and combining the
> output in one response [session scope might help you here].

After doing much research I have learned a lot.

Perhaps someone can verify what I "think" I understand...

You can not submit two forms, because one a document submits a form,
the document loses focus.
Fix would be to create a script that would copy data from one form
over to a hidden field in the form I am submitting.
Specific to my problem, this is impossible, as cftree selected node
path variable is not created until the form the tree resides in is
submitted.

Fixed the problem by redesigning the page entirely, one form with two
submit buttons.
haaazy - 25 Jun 2008 18:51 GMT
I'm using cf 7.

The page I am working with has two forms, because the action page handles the
request in this way.  User has to choose which form as each form corresponds to
a different set of "reports".  The third form (a cfform) has the treeview that
I need to get the node path for on my action page.  I have tried numerous
methods (copying variable to form with javascript, submitting two forms at
once, etc) but have been unable to succeeed.  Any feedback is appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.