Forums

Load JS: &regione= becomes ®ione=

emmexx 09 Nov, 2013
In a Load JS action I wrote something like:

<?php 
  $link = $form->data['myvar'] . '®ione=';
?>

I save the form.
When I reload the form, and when I check the link created using that variable, I get:
<?php 
  $link = $form->data['myvar'] . '®ione=';
?>

I suppose there's some wrong regex here.

Bye
maxx
GreyHead 10 Nov, 2013
Hi Maxx,

The Load JS action will take PHP but the output should be good JavaScript. What is your code here doing?

Have you tried using & instead of just & ?

Bob
emmexx 10 Nov, 2013

Hi Maxx,

The Load JS action will take PHP but the output should be good JavaScript. What is your code here doing?


I reported this as a bug because the problem appears inside the CF editor.
The code I quoted in my OP is php code, no output, I just assign a php variable that I want to use later in javascript.
You can try adding that code to a Load JS action, save it, reopen it and check the code.

Have you tried using & instead of just & ?


I used:
<?php
  $link = $form->data['myvar'] . '&' . 'regione=';
?>


Bye
maxx
GreyHead 10 Nov, 2013
Hi Maxx,

I can see what is happening now (though not why). The ® is being treated as an HTML entity despite the missing ;. My suggestion to use & works for one save only - on the second save you get the same problem.

Your suggestions looks like the best one in the Load JS action.

In a Custom Code action it doesn't see to be a problem.

Bob
This topic is locked and no more replies can be posted.