How to dynamically change background image of form per page?

  • Profile Image
    Lana1994
    Asked on January 14, 2015 at 07:24 PM

    In the form I made, the background picture is the same for all the pages, is there a way where I can have a unique background for each page (created by page breaks)?

  • Profile Image
    Charlie
    Answered on January 14, 2015 at 09:38 PM

    Hi,

    Unfortunately, it seems that it is not possible. As the background image that you have is the cover image for the phone. Also, this involves transitions and applying specific styling when we're on a different element. 

    This, however, could easily be achieved if you are using javascript to your form. But, for you to insert a Javascript, you will need to embed your form's full source code a web page and insert the code inside the form's source code.

    Here's the guide on how to get the full source code of the form: http://www.jotform.com/help/104-How-to-get-the-Full-Source-Code-of-your-Form 

    This is a sample javascript that we can add:

    $(document).ready(function() {

    $('ul:nth-child(1)').click(function () {

    $('.form-all').css("background", "red");

    });

    });

     

    I hope this gives you an idea on how to proceed. Let us know if you need assistance on this one.

    Thank you.

  • Profile Image
    abajan
    Answered on January 15, 2015 at 10:01 AM

    @Lana1994

    Here's a clone of your jotform having the requested functionality. Just for the demonstration, I disabled its conditions and required field checks. Do let us know what you think.


    Thanks

  • Profile Image
    abajan
    Answered on January 15, 2015 at 07:26 PM

    Hi again,

    I have re-written the script in the demo and it now works with all of the jotform's conditions enabled and the required fields. Please test it and let us know if that's the way you wanted it to work.

    Of course, if you were to submit it, the data would go to my account because the jotform is in my account. However, we will show you how apply the solution to your own jotform, as well as how to use your own images.

    We look forward to hearing from you.


    Thanks

  • Profile Image
    natupote
    Answered on June 20, 2016 at 09:47 PM

    Hello, sorry my english

    where i put the script of abajan write?

  • Profile Image
    Chriistian
    Answered on June 20, 2016 at 10:14 PM

    Hello @natupote. This seems to be an older thread. To better assist you and to avoid any confusion, I have moved your question to a new thread. Simply follow this link to view your thread: https://www.jotform.com/answers/865222.