PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

readonly fields becomes editable in form's error

  1. Muhammad Mustafa
    Member

    I am using the workaround posted in the form to make 2 text input fields in my form a readonly input and it works just fine, just notice that these 2 readonly fields becomes editable after the form is submitted with some missing or wrong data!!!!
    I tested it over 10 times, the fields are NOT editable as long as the form isn't yet submitted, left some fields blank and submitted, the error messages appeared, and, bingo! the 2 readonly fields are now editable!!!!
    What's wrong with this??

    Posted 13 years ago on Thursday May 12, 2011 | Permalink
  2. Are you using the ajax form submission method? If so, I'm assuming the jQuery workaround you're talking about changes the input attribute on the document load. Since the ajax method doesn't actually reload the document, the attribute isn't changed when the fields are returned for a validation error.

    Posted 13 years ago on Thursday May 12, 2011 | Permalink
  3. Muhammad Mustafa
    Member

    Aha, disabled ajax and it worked OK, anyway to go around this problem and keep ajax??
    I want ajax=true to avoid duplicate submit by disabling the submit button once clicked, ajax=true do this by default, if there's any workaround/filter to disable the submit button once clicked without ajax=true gonna be great and just what I am after, its an order form and a duplicate orders gonna be a lot of pain later...

    Posted 13 years ago on Friday May 13, 2011 | Permalink
  4. Hi Muhammed,

    http://www.gravityhelp.com/documentation/page/Gform_page_loaded

    This jQuery event will let you reapply your attribute modification script every time the page is reloaded when using ajax.

    Posted 13 years ago on Friday May 13, 2011 | Permalink
  5. Muhammad Mustafa
    Member

    Thanks David
    I've added it but its not working :(
    While re-enabled ajax, ajax=true, In my head section I've the following code

    jQuery(document).bind('gform_page_loaded', function(input, 2, 1){
    });

    Where "2" is my form ID, and "1" is page one of my form (my isn't a multi-pages form, so assumed 1 is the right integer, however, I tried it with "0" as well and didn't worked too)
    What's wrong? what may I apply wrongly here??

    Posted 13 years ago on Saturday May 14, 2011 | Permalink
  6. Muhammad Mustafa
    Member

    Any answer to my question here guys?

    Posted 13 years ago on Wednesday May 18, 2011 | Permalink
  7. Hi Muhammed, Could you paste a link to your website?

    Posted 13 years ago on Wednesday May 18, 2011 | Permalink
  8. Muhammad Mustafa
    Member

    My site is in developing process, yet, so far located within my localhost!

    Posted 13 years ago on Friday May 20, 2011 | Permalink
  9. Muhammad Mustafa
    Member

    Hey guys, any reply here?? a week with no answer!

    Posted 13 years ago on Sunday May 29, 2011 | Permalink
  10. Hi Muhammed,

    I'd recommend uploading a copy of your site to an accessible URL so that we can take a closer look and better assist you.

    Posted 13 years ago on Monday May 30, 2011 | Permalink