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

on page refresh loosing the cfform data

New Here ,
Apr 16, 2011 Apr 16, 2011

Hi,

i begineer to the coldfusion and i am having hard time to get it solve.

i have a simple cfform like this.

  <cfform   name="DropDown" method="post"  preservedata="yes"  action="#attributes.pageurl#"  >

     <cfinput type="text" name="txtEmpFName" class="empInfo" required="yes" message="First Name is Empty." value="#variables.txtEmpFName#"/>

     <a href="#attributes.pageurl#?action=add&FamilyMember=2" >ADD Family Membe111</a>

     <input type="submit" class="form_button" name="Empdata" value="Continue">

</cfform>

in the above code, when i click on the submjit button then i can still see the value in the txtempfname. but when i click on the "a href" which calls same page, loosing value in the txtEmpFname (when i click on the link page refreshes and loosing the data.)

Can any one please help me out how to fix this issue.

Thanks a lot in advance!!!!!!

TOPICS
Getting started
459
Translate
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
Enthusiast ,
Apr 17, 2011 Apr 17, 2011
LATEST

The preservedata="yes" attribute and it's behavior, retaining submitted values, only apply to HTTP post requests, not HTTP get requests.  Bear in mind that a hyperlink is not a standard way of posting a form, so I would avoid using it that way.

If I understand your problem you need to present UI to add a family member on the page.  You might investigate JavaScript and AJAX as a method to do this without needing a form post or get request.

The CF docs can get you started, but implementing AJAX will require some trial and error on your part.

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-7a01.html...

Translate
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