Conditions not working when copying the source code

  • hoho32
    Asked on September 15, 2014 at 2:04 PM

    I've setup a condition it works only on the form domain http://form.jotform.me/form/42553579206459?

    but not on my domain, where i got the full source code in my page http://molham.ae/nabbesh/register-client.html

     

     

     

  • jonathan
    Replied on September 15, 2014 at 3:32 PM

    Hi,

    Please take note that every time you uses the jotform full source code embed on your website, you will need to re-embed the jotform always if the jotform is updated/modified.

    Otherwise, if you do not re-embed, the version of the embedded jotform will not be the same to the updated jotform.

    After updating jotform, please re-embed again the full source code into your website. Then check if the conditions are now working on the embedded jotform.

    Hope this help. Inform us if issue persist.

    Thanks!

     

  • hoho32
    Replied on September 15, 2014 at 3:35 PM

    i've already did that, same issue. 

  • David JotForm Support
    Replied on September 15, 2014 at 5:06 PM

    Hi,

    I embedded a cloned version of your form in to a test page using the source code and the condition based on your radio button seemed to work just fine.  However, when I tested your embed code, the condition did not work.  Here a tested working version of your forms source"

    http://pastebin.com/TYu8nUYs

    That code should be the proper source embed.

    If you are still having trouble after embedding that code.  Let us know and we will see what else we can do,

  • hoho32
    Replied on September 16, 2014 at 3:14 AM

    Thanks! it works now! 

    I don't know where was my problem :) if i found out or duplicated that problem again i will let you know!

  • Ashwin JotForm Support
    Replied on September 16, 2014 at 6:41 AM

    Hello hoho32,

    On behalf of my colleague, you are welcome.

    Do get back to us if you have any questions.

    Thank you!

  • hoho32
    Replied on September 16, 2014 at 6:56 AM

    I actually wanted to asked you, how i can apply the conditions from the jotform and take only there source code and apply it on the form.

    I just wanted to find the code where jotform execute for these conditions, where i can find them?

     

      

  • Ashwin JotForm Support
    Replied on September 16, 2014 at 8:54 AM

    Hello hoho32,

    If I understand your question correctly, you need to just copy the condition codes from your JotForm's source code is that correct?

    When you download your JotForm's source code, you will see the JavaScript code added there. Please check the screenshot below on where to find the conditions in the source code: 

    Conditions not working when copying the source code Image 1 Screenshot 20

    Hope this answers your query.

    Do get back to us if you have any questions.

    Thank you!

  • hoho32
    Replied on September 16, 2014 at 12:13 PM

    Ok i got the code thanks, but this one hides the input only, i wanted to hide the whole li, is there a js code i write to hide the whole <li> if i didn't clicked on the radio checkbox 

     

    Conditions not working when copying the source code Image 1 Screenshot 20

  • Ashwin JotForm Support
    Replied on September 16, 2014 at 1:32 PM

    Hello hoho32,

    I am not sure what all changes you have made in your form's source code. It seems the condition to show hide the field was added later after downloading the from's source code. This is the draw back of embedding form with its source code. You have download the form source code again and embed it in your web page.

    For now you can try to use the conditions from the following URL and see if that solves this problem: http://pastebin.com/pVaCWeuQ 

    Do get back to us if the issue persists.

    Thank you!

     

  • hoho32
    Replied on September 18, 2014 at 3:04 AM

    no it didn't work I've solved this issue by this code

     

    // we target the element from which we want the click action to be
        document.querySelector('#q5b').addEventListener('click', function() {

            // skips to which field you want
            fform._showField(4);


            // we need this if we want to go to the final OVERVIEW part
            setInterval(function() { document.querySelector('.fs-continue').click(); }, 200);
        });

  • Ashwin JotForm Support
    Replied on September 18, 2014 at 5:10 AM

    Hello hoho32,

    I am glad to know that you solved it yourself.

    Do get back to us if you have any questions.

    Thank you!