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

    Compatibility with ASP.net? developer question.

    Asked by fede_lmds on May 08, 2013 at 01:28 PM

    Hi, I need to integrate my JotForm with a asp.net page. I tried everything.

    The thing is that, for asp.net to work properly, I need to add the runat="server" attribute to the <form>  of jotForm, but when I do that, I loose the validations of the elements (like required onblur, or the validation of all the inputs when i press the submit button).

    Or there is a javascript function defined that I can call more manually like <input type="submit" ONCLICK="ValidateAllFunction" > ? because in that way I think I would be able to do it. 

    Can't use iFrames. Can't use php.

    compatibility ASP ASP.NET JotForm elements
  • Profile Image

    Answered by sidharth_kch on May 08, 2013 at 02:50 PM

    @fede_Imds

    Which version of ASP.Net are you using?

    In Asp.NET 4.0, You can directly embed your form script inside a content place holder. Like this:

    <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

        <h2> Welcome to ASP.NET!  </h2>

        <p>

            <script type="text/javascript" src="//form.jotformpro.com/jsform/31271347111947"> </script>

        </p>

    </asp:Content>

    This should work. Let us know if you have any issue in this.

    Thanks,

    Sidharth

  • Profile Image

    Answered by fede_lmds on May 12, 2013 at 09:01 PM

    Thanks for the response.

    I am using ASP.net 4.0, but ContentPlaceHolder is for page's that uses Master Pages, and I am not using a Master Page.

    If I put the runat="server" in the JotForm, some validations still work (like the numeric one's, if yo put an lower number than the minimum alowed) but others stop working, like when yo navigate from a required input to another, leaving it empty, it doesn't mark "this field is required". Also the button validation of all input required items stop's working. 

    I need to have the source code in my page, can't call <script type="text/javascript" src="//form.jotformpro.com/jsform/31271347111947"> </script>

    I didn't find any solution so far. Please let my now if there is another way. 

  • Profile Image
    JotForm Support

    Answered by jonathan on May 12, 2013 at 09:27 PM

    Hi,

    You can get the form's source code using this guide http://www.jotform.com/help/104-How-to-get-your-Form-Source-Code . This will allow you to host the form and at the same time customize it to your need.

    ---

    With regards to your inquiry on embedding the form to Asp.net page, I think you can just embed the form's script code directly into the aspx page. It should be only at least inside the HTML tags. 

    something like this

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="test.test" %>

       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

       <html xmlns="http://www.w3.org/1999/xhtml">

       <head runat="server">

           <title>Test Aspx</title>

        

      </head>

       <body>

           <form id="form1" runat="server">

    <script type="text/javascript" src="//form.jotformpro.com/jsform/31271347111947"> </script>

               <div id="test"></div>

               <a  target="_blank" href="."

                    style="display:block;height:450px"

                    id="player">

               </a>

           </div>

           </form>

       </body>

       </html>

     

    In JotForm embed to SharePoint guide, the form was easily embedded in the web parts using its script code and this are aspx page.

    Hope this help.

    Thanks.

  • Profile Image

    Answered by fede_lmds on May 15, 2013 at 02:19 PM

     

     

    Thanks for the response. Yes in that way it works, but I can't use it like that.

    I have to paste the code directly to my aspx page, in order yo make the button runat=server, so I can process the data in the server. When I do that, the required validations stops working :(

     

    Something like:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="test.test" %>

       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

       <html xmlns="http://www.w3.org/1999/xhtml">

       <head runat="server">

           <title>Test Aspx</title>

    <script src="http://cdn.jotfor.ms/static/jotform.js?3.1.437" type="text/javascript"></script>

    <script type="text/javascript">

    JotForm.init(function(){
      $('input_5').hint('ej: 23');
      $('input_6').hint('ej: 23');
      });

    </script>



     </head>

       <body>

           <form id="form1" runat="server">

     

    <form class="jotform-form" action="http://submit.jotformz.com/submit/31316975668668/" method="post" name="form_31316975668668" id="31316975668668" accept-charset="utf-8">

      <input type="hidden" name="formID" value="31316975668668" />

      <div class="form-all">

        <ul class="form-section">

          <li id="cid_1" class="form-input-wide">

            <div class="form-header-group">

              <h2 id="header_1" class="form-header">

                Nueva Nota

              </h2>

            </div>

          </li>

          <li class="form-line" id="id_5">

            <label class="form-label-left" id="label_5" for="input_5">

              Número<span class="form-required">*</span>

            </label>

            <div id="cid_5" class="form-input">

              <input type="number" class="form-number-input  form-textbox validate[required, Numeric]" id="input_5" name="q5_numero5" style="width:84px" size="8" data-type="input-number" />

            </div>

          </li>

          <li class="form-line" id="id_6">

            <label class="form-label-left" id="label_6" for="input_6">

              Año<span class="form-required">*</span>

            </label>

            <div id="cid_6" class="form-input">

              <input type="number" class="form-number-input  form-textbox validate[required, Numeric]" id="input_6" name="q6_ano" style="width:84px" size="8" data-type="input-number" data-numbermin="1900" />

            </div>

          </li>

          <li class="form-line" id="id_20">

            <label class="form-label-left" id="label_20" for="input_20">

              Motivo<span class="form-required">*</span>

            </label>

            <div id="cid_20" class="form-input">

              <textarea id="input_20" class="form-textarea validate[required]" name="q20_motivo" cols="40" rows="3"></textarea>

            </div>

          </li>

          <li class="form-line" id="id_2">

            <div id="cid_2" class="form-input-wide">

              <div style="margin-left:156px" class="form-buttons-wrapper">

                <button id="input_2" type="submit" class="form-submit-button" runat="server" >

                  Aceptar

                </button>

              </div>

            </div>

          </li>

          <ul class="form-section-closed" style="height: 60px;clear:both;" id="section_34">

            <li id="cid_34" class="form-input-wide">

              <div class="form-collapse-table" id="collapse_34"><span class="form-collapse-mid" id="collapse-text_34">Click to edit this text...</span><span class="form-collapse-right form-collapse-right-hide">&nbsp;</span>

              </div>

            </li>

            <li style="display:none">

              Should be Empty:

              <input type="text" name="website" value="" />

            </li>

          </ul>

      </div>

      <input type="hidden" id="simple_spc" name="simple_spc" value="31316975668668" />

      <script type="text/javascript">

      document.getElementById("si" + "mple" + "_spc").value = "31316975668668-31316975668668";

      </script>

    </form>

     

     

     

           </form>

       </body>

       </html>

     

  • Profile Image

    Answered by sidharth_kch on May 15, 2013 at 02:53 PM

    @fede_lmds

    Yes it won't work if you add runat="server". It will not get any functions on your code behind. You need to register scripts for Serverside controls to use java scripts right?

    But still i am unable to understand why you need to add runat server and what data you will proces on server side? Data will anyway be posted to jotform server. Check action script.

    You cannot make your form runat="server" too.

    Thanks,

    Sidharth