Can I make a hidden field required?

  • OrchardCorsetContact
    Asked on August 28, 2013 at 1: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.

  • Welvin Support Team Lead
    Replied on August 28, 2013 at 4: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.

    Can I make a hidden field required? Image 1 Screenshot 20

    Thanks

  • pinoytech
    Replied on August 28, 2013 at 6: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!

  • OrchardCorsetContact
    Replied on August 28, 2013 at 6: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.

  • Welvin Support Team Lead
    Replied on August 28, 2013 at 7: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

  • Welvin Support Team Lead
    Replied on August 28, 2013 at 7: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

  • elgabriello
    Replied on April 5, 2015 at 1: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

  • Kiran Support Team Lead
    Replied on April 5, 2015 at 2: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.