What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.

  • Profile Image

    How to make a condition that if the form is opened on a mobile device, show something

    Asked by SCARHS on February 14, 2017 at 06:23 PM

    Hi support,

    Would there be anyway to detect when the form is loaded on mobile so I could make a conditional logic out of it
    IE.: showing a picture when A)user is on mobile B)User has answered a specific question on the form.


    Let me know thank you.

  • Profile Image
    JotForm Support

    Answered by EltonCris on February 15, 2017 at 12:26 AM

    I could not find any workaround to achieve this in the form builder alone.

    But you can achieve this when you use your form source code.


    And inject custom script in the source code that would fill a value in a specific field when the form is opened on mobile. And then you can use the filled value as the trigger point for your mobile condition.

    You can find sample script from this article http://stackoverflow.com/questions/11381673/detecting-a-mobile-browser.

    If you need further help on this, let us know.


  • Profile Image

    Answered by SCARHS on February 15, 2017 at 09:08 PM

    If I understand correctly, I would need to inject javascript code into my form to fill a certain field. 

    How do I inject code into my form? Would I need my own website with iframe to do that?


    Thank you.

  • Profile Image
    JotForm Support

    Answered by Chriistian on February 16, 2017 at 02:34 AM

    Yes you need to inject JavaScript code into your form by downloading the source code as suggested by my colleague. After downloading the source code of your form, you need to open it to a text editor like Notepad and then inject the JavaScript. 

    Would I need my own website with iframe to do that?

    You need to host your form's code to your own server to display the form with injected code. We recommend you to look for freelancers that can help you set this up. You can hire either in http://www.upwork.com/ or http://www.freelancer.com/.

    If you need further assistance, please let us know.

  • Profile Image

    Answered by SCARHS on February 16, 2017 at 08:33 AM

    Thank you support, that answered my questions.