Support » Plugin: Smart Forms - when you need more than just a contact form » When i make a huge form and coppy it some java data dont work on the new copy

  • Resolved aselevideoteknik

    (@aselevideoteknik)


    I am still at it with my calendar and got January to work with 3 different calculations on overtime, the problem comes when i try to copy it.

    However when i did as you explained in the last post to just make a copy the form and rename. Some of the field calculations stop working and some works.

    this happens in when i try it live, however it works in preview mode as shown in the image below

    A print screen

    The page is in Swedish but the form should be easy to understand anyway.
    You can see the form here https://www.scherdins.finance/?page_id=1458

    i we tried allot of ways to try to correct this and the only way i find working is to completely rename all the IDs of every single tags and rename every single bit of code that have a id within it, while fooling around within February, I make it work but for me that’s alott of lines of codes that need to be renewed, unless i renam the id i don’t get the code to update, and that is allot of ids to be renamed for every month.

    So please tell me that there is an easier way to do this ?
    what makes things strange is that every code for overtime at Sundays calculates and works without a problem. Its only less code calculating inside them. And ofc everything in January works 100%! but not the copy i made from it.

    Once i get these to work i will buy your addons to make pdfs attachments, Your plugin have saved me tons of time already !

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author EDGARROJAS

    (@edgarrojas)

    So in preview it works but it doesn’t work when you execute the form? And if so, do you have multiple forms in the same page? It is possible to have multiple forms in the same page but if this is the case all the ids should be different, otherwise the ids of one form could be conflicting with the ids of the other,

    I also opened the link that you send me but i done see any form, should i click somewhere to see it?

    aselevideoteknik

    (@aselevideoteknik)

    The link go to simple month selection or ” From selection ”

    Its just a quick selection site made of links that opens the different forms the idea is to have one multi form per month, Januari = January is the first form i made and are working.

    The forms are built to report working hours from employed in different companies and then sum up some overtime and send it into a Email server that sort the mails out and delete them.

    January is the first form i worked on it works as it should.

    Even if i rename all the id´or even remake the entire from with new text inputs in the copy´s i get the same results, If i make a copy by export and import it give the same results as clone.

    The rest of the links go to forms that are copy´s from Januari.

    Also tested this on different browsers both by copy and clone just in case.

    Anyhow the error message i get from firefox on the copy´s is

    Error catched SyntaxError: "'#' not followed by identifier"
    
    GetValueFromFormula formula.ts:48
    UpdateFieldWithValue formula.ts:32

    +another 10-15 rows like those.

    Also if you want to test the form out i will include a copy of the exported file i tried to make a copy from to see if it were any difference from a using the “Clone” function

    I had to zip it WordPress didn’t like the file format.

    Link to zip file

    We use JetPack & LiveCoposer as main addons + some social feeds plugins.

    Plugin Author EDGARROJAS

    (@edgarrojas)

    Hello!

    The ids of the formulas doesn’t seems to be the same in the forms, probably that is the issue?. For example, In january for example there is a form with id of rnField241 and label of “MM”, this field is used in the formulas.

    In February a field with id of rnField241 is also used in formulas but there is actually no field with id of rnField241 in there. So the formulas that are trying to use that field show an ‘undefined’ error (because they tried to use a field that is actually not defined).

    aselevideoteknik

    (@aselevideoteknik)

    Yes February is a from i were trying out some chances to make it work so its still in progress, so only February are not completed, Even if i correct those i still don’t get the calculations to work if i only take January that do work and clone it and run the clone the calculations stop working, like the image abow, I we even tried another WordPress site to import the exported copy of January and on that account i don’t have a single addon except for the form, this is were the fun part is, In that new account even if i manually remove everything inside the exported multiform and just remake one day i get the same result, It works in preview but not live.

    If i make a new form all together and just copy paste the calculation and make just one day it do work but not if i clone it or somehow copy it ?

    aselevideoteknik

    (@aselevideoteknik)

    when i updated the last update i now get 2 error messages

    Error catched SyntaxError: “‘#’ not followed by identifier”
    Error catched TypeError: “data is undefined”

    all the id´s are correct i even made a clone and renamed them all even in code i still get it to work in preview but not in live so it have to be something with my code but then why do the first from work and not the others

    this is driving me nuts.

    aselevideoteknik

    (@aselevideoteknik)

    also almost all my codes look like

    if x == 5 && y <= 20) { return (1000+(a*100)+(b*500)); }
    else if x == 10 && y<= 20) { return (1000+(a*100)+(b*500)); }

    were x & y is ids from other pages in the same multiform and a & b is id´s the same page in the multiform

    exempt that i can have 10-200+ else if rows 🙂

    aselevideoteknik

    (@aselevideoteknik)

    I have to add this … i did open the WordPress db and did export the from manually and imported it in my test WordPress account without any addons and when testing that way, in a fresh WordPress installation it do calculate live!. yay

    So i did a virtual server copy of the WordPress site and deleted the pages and addons just to see whats make things well NOT work.

    So i found out that if you make a page with the Jetpack´s Drag & drop front-end page editor that automatically gets activated when you install Jetpack.

    it somehow corrupts the imported or cloned copy´s made in Smartfroms

    I delete all the pages made with Jetpack and made new pages with simple Shortcodes tags in new pages manually, that makes the forms work live again!

    So remove the Jetpack block-editor pages and just re-saved the forms make them work again without having to redo them. (ofc you have to remove the function in Jetpack as well “don´t have to delete the addon just deactivate the page function.”)

    Did it on most of my forms, only have this calendar from left !

    Once you we read this know that Jetpack can make forms unable to calculate live, you can put this tread as resolved once you read this!

    Thanks for your help in this !

    Plugin Author EDGARROJAS

    (@edgarrojas)

    Oh that’s weird, thanks for letting me know. I will check why that conflict is happening.

    Regards!

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.