Why the background image URL is changing to relative URL automatically?

  • askmeabout
    Asked on October 2, 2017 at 11:39 PM

    Hi,

    The form https://form.jotformpro.com/71481663392966 is published here: http://queens.by/new_jotform.

    My custom css on lines 126 and149 is 

    background: url(http://queens.by/img/buttons.png) !important;

    That works correct on the form builder page.

    But when the css shows up on the page of my site, the code is

    background: url(//queens.by/img/buttons.png) !important;

    And the url //queens.by/img/buttons.png leads to the address https://queens.by/img/buttons.png, which doesn't exist. 

    What would you recomend to solve this problem?

  • Nik_C
    Replied on October 3, 2017 at 2:58 AM

    The issue is related to the URL. The URL is changing automatically to relative URL and the reason could be that the URL of the image is not HTTPS secured.

    Therefore, I uploaded the image to our server and changed your URL, it is showing fine:

    Why the background image URL is changing to relative URL automatically? Image 1 Screenshot 20

    I changed the 126th line in your CSS.

    Please check and let us know if you have any further questions.

    Thank you!

  • askmeabout
    Replied on October 3, 2017 at 8:16 AM

    Could you please do the same with icons on lines 76 and 93?


  • Chriistian Jotform Support
    Replied on October 3, 2017 at 11:20 AM

    I have updated the background CSS code in line 76 and 93 on your form. However, I noticed that the CSS code is working on the Form Builder but not on the Preview of the form.

    Why the background image URL is changing to relative URL automatically? Image 1 Screenshot 30

    Why the background image URL is changing to relative URL automatically? Image 2 Screenshot 41


    I am further investigating the issue. Please allow me to further investigate this issue. Will get back to you once I fixed this.

  • Chriistian Jotform Support
    Replied on October 3, 2017 at 11:32 AM

    It seems I was adding the wrong CSS code. The CSS code for the new image is 

    background-image: url(https://cms.jotform.com/uploads/image_upload/image_upload/Nik_C/43955_buttons.png); 

    I have updated now the CSS code correctly, can you please check on your end if this works for you?

  • askmeabout
    Replied on October 3, 2017 at 11:33 AM

    Thank you, we will wait for your response.

    Please admit, that lines 76 and 93 need different files for background. Not buttons.png, but http://queens.by/img/form_checkbox.png for line 76 and http://queens.by/img/form_check.png for line 93.

  • Chriistian Jotform Support
    Replied on October 3, 2017 at 11:58 AM

    Thanks for the additional information. I have updated now the CSS code accordingly. Can you please check if this is now working on your end? 

    Why the background image URL is changing to relative URL automatically? Image 1 Screenshot 20

  • askmeabout
    Replied on October 3, 2017 at 11:29 PM

    Everything works fine, thank you!