Changing the value of the "JotForm.calendarOther" variable in the JotForm.init function does not take effect.

  • Profile Image
    AA_C
    Asked on January 23, 2015 at 10:27 AM

    I am using the select date calendar on my forms. On the French form I wanted it to display the Months and days in French, I changed the java-script and this worked fine but for one thing the "Today" text. I thought by changing it in the java-Script it to would be in French but not so. Here is the Java Script section for the calendar I modified;

    JotForm.calendarMonths = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"];

    JotForm.calendarDays = ["dimanche ", "lundi ", "mardi ", "mercredi ", "jeudi ", "vendredi ", "samedi ", "dimanche"];

    JotForm.calendarOther = {"aujourd'hui": "Aujourd'hui," };  ( This part seams to have no effect)

    Here is formID=33516475949265

     

  • Profile Image
    BDAVID
    Answered on January 23, 2015 at 12:13 PM

    Thanks for letting us know about this, I will try to figure this out, and find a solution for this. If needed, I will forward this to our second level for more assistance.

  • Profile Image
    AA_C
    Answered on January 23, 2015 at 12:15 PM

    Sorry but I did not give the right url at first.

    Great thank you!

     

  • Profile Image
    Carina
    Answered on January 23, 2015 at 02:01 PM

    For this you can edit the form's source code, by searching "today" and replacing it by "aujourd'hui":

    Let us know if we can assist you further.

  • Profile Image
    BDAVID
    Answered on January 23, 2015 at 02:14 PM

    Here is my workaround, since I could not figure out why the "Today" text did not change when edited from the downloaded source code, (same thing you already tried):

    I decided to try to change it with CSS code injection:

    Here is the code that did the trick:

    .button:first-child +td +td{

    visibility: hidden;

    }

    .button:first-child +td +td:after  {

    visibility: visible;

    content: "Aujourd'hui";

    margin-left: -35px;

    }

    Please check my form here: http://form.jotform.co/form/50205470805851

    You may apply this workaround to your form, let us now if you need more help, we will be glad to assist you.

  • Profile Image
    AA_C
    Answered on January 23, 2015 at 02:32 PM

    BDAVID,

    Your css code injection worked perfectly. Although this was the fix I think you need to dig deeper to find out why the java script didn't work.

     

    @CARINA

    The answer that you offered did not resolve the problem as there was no ware in the  embedded source code script with the word "today"  for the calender. I see it on the image but I don't know where this is. You are using Firebug to view the element and this code dose not appear in my editor.

    Thank you both,

    Robert

  • Profile Image
    BDAVID
    Answered on January 23, 2015 at 03:37 PM

    You are welcome, it is quite odd why it is not working from the JS code, so I have reported this to our second level to check further.

    If you need anything else, please open a new thread, we will be glad to assist you.

  • Profile Image
    AA_C
    Answered on January 23, 2015 at 03:42 PM

    So I looked a bit deeper into this scripting and see you use a hidden input for some java script that works on the calender, and creates the code shown above;

    <input type="hidden" id="simple_spc" name="simple_spc" value="41902989566975" />

      <script type="text/javascript">

      document.getElementById("si" + "mple" + "_spc").value = "41902989566975-41902989566975";

     

      </script>

    Do we have access to this or if we want to make an edit as shown or do we use firebug, then copy and past the html make required edits.... etc etc ?

     

    Robert

  • Profile Image
    Mike
    Answered on January 23, 2015 at 05:49 PM

    If you would like to translate the Today word you can use the following format:

    JotForm.calendarOther = {"today":"Aujourd'hui"};

    I think that the 'simple_spc' field is there to protect the form from internet bots, so it should not affect the Calendar field.

    If you need any further assistance, please let us know.

  • Profile Image
    AA_C
    Answered on January 23, 2015 at 06:05 PM
  • Profile Image
    AA_C
    Answered on January 23, 2015 at 06:29 PM

    Hello Mike,

     I see what you have done vs what was done before. I will try this ... ... ...

    And it works as it should ... TNX Mike

    I removed the css code injection ... and all is good!

    You can put this one to bed now.

    regards,

    Robert

  • Profile Image
    Mike
    Answered on January 23, 2015 at 06:48 PM

    You are welcome. Please feel free to contact us anytime.