My first custom widget does not work

  • zingiel
    Asked on December 27, 2017 at 5:07 PM

    Hi,

    I created my first widget by tutorial:

    http://developers.jotform.com/widgets

    I could easily register this component as 'My first widget'.

    I put it on my form 73604527712354.

    Did not work.

    I have a picture in Chrome:

    1514411887Schowek 1 Screenshot 10

    and I should show a text input.

    When I open a link to the file 'simple.html', which is on my server, in my browser, it displays well, and this link is provided in the 'Widget IFrame URL *' property of my widget.

    I do not understand where the problem is?

  • Richie JotForm Support
    Replied on December 27, 2017 at 6:08 PM

    I have checked your form, is this the output of your widget?

    My first custom widget does not work Image 1 Screenshot 20

    Kindly clear your form cache and see if it works.

    How-to-Clear-Your-Form-Cache


  • zingiel
    Replied on December 29, 2017 at 10:03 AM

    thanks,

    but I did this cleaning and unfortunately my widget still does not work :(

  • Kevin Support Team Lead
    Replied on December 29, 2017 at 10:38 AM

    Like my colleague, I have been testing your form and the widget seems there: 

    My first custom widget does not work Image 10

    I would recommend you to check that the widget's link is not blocked on your end, you may also turn off any security software or ad on that you have installed on your browser. 

    If possible, please try with a different network or device, if the problem persists, let us know. 

  • zingiel
    Replied on December 29, 2017 at 1:27 PM

    I tried,

    I changed Chrome browser to Edge, and back to Chrome, disabled AdBlock, disable Chrome 'Protect you and your device from dangerous sites', and it did not help either.

    But I did like you, i.e. in the Chrome menu 'More tools' I chose 'Developer tools' and found in the source 'src ='//zingiel.ugu.pl/tests/jf/w/simple.html?qid=7&ref=https%3A%2F%2Feu.jotform.com''.

    When I moved the mouse over this 'src' it showed a hint with a link like in 'src' but preceded by 'https:'.

    I took this link from the hint and paste it into the address bar in the browser and ... nothing, i.e. it still does not work.

    But when I removed 's' from this link, I received 'http:' instead of 'https:' and finally my widget appeared as a page of course.

    I think so: why does the address of my widget receive 'https' at the beginning, even though in the settings of my widget I have entered the address 'http://zingiel.ugu.pl/tests/jf/w/simple.html'?

    I saw the difference between 'src' on your screenshot and my 'src': you are '...;ref=http%3A' and I am ';ref=https%3A'.

    What it comes from?

  • Richie JotForm Support
    Replied on December 29, 2017 at 2:03 PM

    I have tested  //zingiel.ugu.pl/tests/jf/w/simple.html?qid=7&ref=https%3A%2F%2Fwww.jotformeu.com

    with https and http, both linked worked for me. The "S" stands for secure,meaning your link is secure. 

    I have checked your form,did you edit your widget? The widget seems missing now.

    My first custom widget does not work Image 1 Screenshot 20



  • zingiel
    Replied on December 29, 2017 at 4:51 PM

    no, I did not change anything in the widget, it's the same from the beginning and it does not work for me.

    Are there any server guidelines on which this html can be placed?

  • Kevin Support Team Lead
    Replied on December 29, 2017 at 5:45 PM

    I have been reviewing your widget and I can see what the issue is, the widget works if I use this link http://www.jotformeu.com/form/73604527712354, but it will not work if I use this one: https://www.jotformeu.com/form/73604527712354

    Now, the widget takes the parent URL domain, as you already noticed:

    My first custom widget does not work Image 10

    The widget's links work on both protocols, HTTP and HTTPS, so you would need to have your widget stored in a HTTPS link as well to get it working, otherwise the form will need to be loaded under HTTP to get the widget working. 

    I hope this info helps. 

  • zingiel
    Replied on December 29, 2017 at 6:31 PM

    Thank you very much for this analysis and advice,

    now I have to look for a free hosting with a secure https link,

    because changing from https to http for a form may not be good.

    Thank you again for your help.

  • zingiel
    Replied on December 31, 2017 at 5:36 AM

    Would you have any offer, where could I put my html file for the widget?

    I tried DropBox, but the DropBox server "provides" this file along with its navigation elements, so yes the https connection is, but the widget is not displayed on the form.

    I was looking for free hosting with the https connection, but I have not found one.

    Maybe, however, are these free web hosting from https?

    Or maybe I can place such files on JotForm?

  • Nik_C
    Replied on December 31, 2017 at 7:15 AM

    We don't have such possibility, but you can try with https://www.000webhost.com, you should be able to do that for Free.

    Let us know if you have any further questions.

    Thank you!

  • zingiel
    Replied on December 31, 2017 at 3:42 PM

    thanks, I created an account on 000webhost, I uploaded this file simple.html and works :),

    but of course, free hosting gives me a "free" logo too,

    and I do not know why the input is 'undefined' on the left side,

    1514752913Przechwytywanie5 Screenshot 10

    I think that without access to a commercial server I can not do it properly ...

  • Elton Support Team Lead
    Replied on December 31, 2017 at 5:09 PM

    It shows undefined because there is no QuestionLabel parameter passed into your widget.

    My first custom widget does not work Image 1 Screenshot 30

    You should add this parameter to your widget settings on the developer's page.

    Example:

    My first custom widget does not work Image 2 Screenshot 41

    If you need further assistance, let us know.

  • zingiel
    Replied on December 31, 2017 at 5:17 PM

    Yes !,

    it works :)

    thanks for the help,

    I know a little more now.