Skip to main content
Participant
April 17, 2011
Question

Clicking on link i am loosing form values.

  • April 17, 2011
  • 2 replies
  • 596 views

I have couple cfinput type="text" required=Yes, i have links as well and when user clicks on the links then page calls the same page as shown below.

but my problem is when i click on link, this link is in the bottom of the page and i have 5 text boxes. if i enter some text in the text boxes and clicking link is disappearing values from the text box. but i need these values to stay in the form.

I am using the below link to add or remove some values from the form.

      <a href="#attributes.pageurl#?action=add&SFM=1&TFM=0">ADD Family Member</a>    

Please let me know if you have any idea why i am loosing values in the text boxes from cfform by clicking on the link.

Thanks in advance.

    This topic has been closed for replies.

    2 replies

    talofer99
    Inspiring
    April 21, 2011

    I'm not sure I understood you currectly but ...

    If your cf page look like this :

    <form>

         <input name="whatever">

         <input name="whatever2">

         <input name="whatever3">

         ..

    </form>

    <a href="linkoherpage.cfm">link</a>

    Form, to be submited (send its info to the next page) need:

    1. Submit buton

    OR

    2. a form of a link/button that will use Javascript to submit the page. the Js script will look like : document.formname.submit()

    You can add the info you want ot be passe in the URL (?var=..) into the ACTION part of the FORM ie :

    <form action="page.cfm?var=1" method="post">

    once a Link (<a HREF...) is click, the browser REFRESH the page, and since the form was not SUBMITED the info dosn't "exists" in the next page (the one you redirected the user to).

    Hope this clear things up

    April 19, 2011

    you can save the values of the textbox as a query string or using hidden fields in the form, when passing variables while Paging. Maybe you are not storing the previous values and upon form submission [whether it is to a new page or the same page], all the previous values are lost. May be these helps.

    Or Please provide further code details to understand your question better.

    Vijayvijay77.