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

    Can you use php code in the default value to populate a hidden field?

    Asked by jared1982 on February 28, 2014 at 02:05 PM

    I want to populate a default value with a PHP variable in a hidden field. Whenever I try and add the code to the default value its cuts off the "<?php echo $this" at the beginging. Is there any workarounds to make this work?

    <?php echo $this->htmlEscape($this->helper('contacts')->getUserName()) ?>

  • Profile Image
    JotForm Support

    Answered by Mike_T on February 28, 2014 at 04:08 PM

    Thank you for contacting us.

    It should be possible to populate the value with php. Are you trying to use mentioned php code in combination with the form source code, or some other embedding method?