Mandatory Fields are not working

  • Profile Image
    Asked on September 11, 2013 at 12:47 PM

    Hi, this is a serious issue for us:


    We would like to set our form live, but after we use the Javascript integration, we don't see mandatory fields working.



    I have tried the iFrame integration, however, using the iFrame method, I am not able to pre-populate certain fields (see example link)


  • Profile Image
    Answered on September 11, 2013 at 01:40 PM

    Hello cheiler,

    The required fields of your form is not working becuse of the script conflict between jotform and other script of your webpage.

    Only way to resolve this issue is to embed your form using iFrame script. The url parameter will still work with iFrame. 

    Here is a sample iframe code with url parameter:

    <iframe id="JotFormIFrame" onload="window.parent.scrollTo(0,0)" allowtransparency="true" 

    src="//" frameborder="0" style="width:100%; height:465px; border:none;" scrolling="no"></iframe>

    <script type="text/javascript">window.handleIFrameMessage = function(e) {var args =

    (":");var iframe = document.getElementById("JotFormIFrame");if (!iframe)return;switch (args[0]) 

    {case "scrollIntoView":iframe.scrollIntoView();break;case "setHeight" = args[1] 

    + "px";break;}};if (window.addEventListener) {window.addEventListener("message", 

    handleIFrameMessage, false);} else if (window.attachEvent) {window.attachEvent("onmessage", 


    Hope this helps.

    Thank you!

  • Profile Image
    Answered on September 12, 2013 at 03:07 AM

    Hi Ashwin,


    I am sorry, your answer is not helpful and wrong.


    first, I copied the javascript on a blank HTML page - there is no other content and no other javascript - so there can't be any other script influencing it.

    Second, you suggst that I add coding on my end to parse the URL and then use the parsed parameters for the iFrame URL - this would require coding on our end.

    The reason why I chose Jotform is that we did not want additional coding work in this instance.

    Please review your javascript and fix the bugs in it that prevent us from using it as it should work


  • Profile Image
    Answered on September 12, 2013 at 04:25 AM

    Hi Christian,

    If you are using iframe embed code, you can append the URL parameters on the JotForm URL. Example:

    <iframe id="JotFormIFrame" onload="window.parent.scrollTo(0,0)" allowtransparency="true" src="//[first]=John&fullName14[last]=Doe&" frameborder="0" style="width:100%; height:7962px; border:none;" scrolling="no"></iframe>

    For more information, please take a look at this article:

    If you need further assistance, please let us know.

    Thank you!

  • Profile Image
    Answered on September 12, 2013 at 04:45 AM

    Hi Pino, thank you, but this does not solve the problem.


    1. The javascript code does not work - I have used an empty HTML page, there is nothing else on it!

    2. To embed in an iframe, I need to parse the URL that I send in an email to the customer and then use the parameters in the iFrame call.

    I really would appreciate if we could solve the problem at hand.

  • Profile Image
    Answered on September 12, 2013 at 04:58 AM


    I played a bit with the form and created a simpler version - the JS works if there is no pagination and pagination RULES set up, e.g. if I specify:

    if dropdown A is selected, jump to page 4, the validation is not executed.

    This causes the mandatory validation to fail.

    Please adjust your script so it first validates mandatory fields, then uses pagination.