Can fields be rendered un-editable to the user?

  • Profile Image
    abajan
    Asked on January 22, 2011 at 06:10 PM

    In relation to my post in another thread, I have been able to set up a system that, although not ideal (one too many steps, IMO), does the job. It requires the use of two forms (referred to hereinafter as form a and form b), where a submission of form a causes an autoresponse message (containing a confirmation link) to be sent to the email address provided by a user.

    The person who receives the message, clicks the link which opens a page containing form b. This form has just two pre-filled fields (Full Name and Email) and a submit button. Clicking the button sends the information contained in the fields to that form's records. If the records of the two forms match, I can be reasonably certain that the initial user who submitted form a and the person that submitted form b are one and the same.

    What I would like to know is if there's a way to prevent the pre-filled entries in form b from being accidentally changed by the user if he/she inadvertently clicks inside the text boxes. I want the form to be submitted without any changes so that the records of forms a and b can be easily matched. Note that I used the words "accidentally changed" above because editing the URL will also change the information in the fields.

    I remember coding a PHP form a few years ago that submitted to itself where the "Thank You" page (in actuality, the same page) contained all the entries submitted but they were "grayed out" and the user could not change them. I can't recall where on the Internet I found the code to accomplish that feat. I'll have to Google it some time.

    This post used to contain two topics but the other one was moved into its own thread to comply with the forum's policy (which I only recently stumbled upon while reading another post) regarding posting more than one topic per thread. The other topic can be found here.

  • Profile Image
    aytekin
    Answered on January 24, 2011 at 09:55 AM

    This is currently not possible on the form builder. However, if you use the full source code, you might be able to edit the code and disable some of the fields for edit. You can add "disabled" and/or "readonly" variables to the input fields. Or you can disable them using JavaScript. 

    Here is how you can get full form source code. Open your form on the Form Builder:

    1. Open "Setup & Share" tab on toolbar,

    2. Click on "Embed Code"

    3. Click on "Source" button and copy it to your web site.

  • Profile Image
    abajan
    Answered on January 25, 2011 at 01:38 PM

    Thanks, I'll give it a go. Incidentally, I found this thread on the subject earlier where one of the contributers basically suggested what you did.

    UPDATE: It worked perfectly. I pasted the source code of the form into my page and placed readonly="readonly" attribute-value pairs into the input fields. I had actually used that trick some time ago but had forgot it. I'm pretty sure that's how I got the PHP page which posted to itself to display unchangeable entries (whose grayed out appearance was achieved via CSS).

    Anyway, thanks again.