Can I make a hidden field required?

  • Profile Image
    OrchardCorsetContact
    Asked on August 28, 2013 at 01:44 PM

    I am developing a plugin for eCommerce websites that uses JotForm to collect data, I need several fields hidden to the end user, but required so that if my script fails to input data the user gets an error and doesnt just believe it was sucsessful.

  • Profile Image
    Welvin
    Answered on August 28, 2013 at 04:33 PM

    Hi,

    Good day! I don't think this is possible, but I will try to come up with a solution later today. Maybe by using the source codes (How to Get Form Source Codes) and adding custom Javascript to the codes.

    How about using a Text Box field and set the properties of this text box as "read only"? This should work for your purpose, I guess.

    Thanks

  • Profile Image
    pinoytech
    Answered on August 28, 2013 at 06:13 PM

    Hi,

    For some reason, your response came out empty. Can you please post it again using this link? http://www.jotform.com/answers/261435

    Thank you!

  • Profile Image
    OrchardCorsetContact
    Answered on August 28, 2013 at 06:50 PM

    Hi Welvin, thanks for the reply. I don't want the customer to see the data as it would be rather confusing to the user. I am sure making a script to make them reqaured or at least give an error if they arent filled in, but I was hoping for native fuctionality to keep it as tight knit as possible.

  • Profile Image
    Welvin
    Answered on August 28, 2013 at 07:43 PM

    Hi,

    You can inject a custom CSS codes to the form that would hide that fields. Even if you hide the fields, that would still capture or would work the way you want it to be.

    Anyway, I'm still finding a way to set hidden fields as required. I'm not able to see a possible solution as of this moment. I'll do my best.

    Thanks

  • Profile Image
    Welvin
    Answered on August 28, 2013 at 07:47 PM

    Here's an example form: http://www.jotformpro.com/form/32397351643962. A Text Box fields are set as required and hidden using Custom CSS codes injected to the form. You can't submit the form.

     

    Thanks

  • Profile Image
    elgabriello
    Answered on April 05, 2015 at 01:06 PM

    Hello Welvin,

    This would be very useful for me, any idea on what is the CSS code and where should I inject it ?

    Regards

    Guido

  • Profile Image
    Kiran
    Answered on April 05, 2015 at 02:06 PM

    Hello Guido,

    Your query is moved to a separate thread and shall be addressed there shortly.

    http://www.jotform.com/answers/546699

    Thanks.