• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Submitting a form in CFDIV Failing

New Here ,
Feb 01, 2008 Feb 01, 2008

Copy link to clipboard

Copied

Does anyone know if there is an issue where you place a cfdiv in a cfform with with another cfform in the cfdiv that would not allow the form to submit in the cfdiv. For Example:

<cfform>
name <cfinput type="text ....>
yada <cfinput type="text ....>
yada <cfinput type="text ....>

<cfdiv>
<cfform>
add another address: <cfinput type="text ....>
<cfinput type="submit" name="submit" value="submit"><!-- submit for cfdiv form -->
</cfform>
</cfdiv>

<cfinput type="submit" name="submit" value="submit"> <!-- submit for master form -->
</cfform>

When I try to submit the form in the cfdiv it reloads the entire page not cfdiv.

Thank you,

Michael
TOPICS
Advanced techniques

Views

793

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 04, 2008 Feb 04, 2008

Copy link to clipboard

Copied

Hello mjfour,

The best technique to use in this situation is to use the ColdFusion.Ajax.submitForm function.

This will cause your form to be sumbitted using ajax instead of a regular html submit

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 04, 2008 Feb 04, 2008

Copy link to clipboard

Copied

Thank you so much for this. I gotta get into the developers guide. Thank you!

I have a follow-up question. I cna get the form to submit as a stand alone, but one I try to bind it or nest it to a cfdiv tag that is already in the cfform I keep getting an error that the form idea can not be found. I am trying to locate an example on how my code should look.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 04, 2008 Feb 04, 2008

Copy link to clipboard

Copied

Michael - I may be misunderstanding what your problem is, but have you tried putting this line of code in the template taht calls the cfdiv?
&lt;cfajaximport tags=&quot;cfform&quot;&gt;

Cheers,

David

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 04, 2008 Feb 04, 2008

Copy link to clipboard

Copied

I'm such a n00b!!! Code attached....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2008 Feb 05, 2008

Copy link to clipboard

Copied

Yeah, it is very odd, essentially here is my code:

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 05, 2008 Feb 05, 2008

Copy link to clipboard

Copied

Michael - I'm not an expert on this subject, but at a first glance, I see that you have the CFFORM tag outside the CFDIV. I'm not sure what the scoping or precedence would be in this instance, but have you tried keeping the form inside the CFDIV? I'm not sure how that affects what you are trying to achieve.

Cheers,

David

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2008 Feb 05, 2008

Copy link to clipboard

Copied

LATEST
Yeah, that is my issue, I am nesting forms. The parent form has no bearing on the binded form in the cfdiv. It is associated data. I think what I want to do is not possible.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation