Copy link to clipboard
Copied
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!!!!!!
Copy link to clipboard
Copied
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.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more