Skip Navigation

[Resolved] Javascript CRED editor . Looks like a Parser issue

This support ticket is created 8 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 7 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#379184

I'm writing a javascript in a CRED form, and after clicking the update button, the original script is modified. Some coding lines removed and resulting in a mess code.

No error message is displayed.

I've done some investigation trying to find out what was causing it and finally I've found that a "FOR" loop with a nested "IF" statement, is not parsed correctly when updating the CRED form.

Just for debugging purposes, I've written the simplest possible javascript code, in a brand new CRED form, and I've confirmed the issue was there:

jQuery('.cred-field-post_title').click(function(event){
  
  for (var i=0; i<3; i++){
    if (i>2) {i++;}
  }

});

After updating the form, the code was modified to:

jQuery('.cred-field-post_title').click(function(event){
  
  for (var i=0; i2) {i++;}
  }

});

Note this is not my actual code, but it has the same issue.

Thanks,

Miquel

#379187

Just now realized, when watching in this post above both code versions, the original and the modified, that CRED has removed everything inside the "<" and the ">" chars, so it looks like the issue is not related to nesting for and ifs statements, but related to using these chars.

#379350

Dear Miquel,

Thanks for the feedback, I have been able to duplicate same problem, and put it into our to-do list, our developers will take care of it.

#419176

Dear Miquel,
This bug should have been fixed in the latest version of CRED, you can download it here:
https://toolset.com/account/downloads/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.