Questions and discussion about using ProcessMaker 2: user interface, running cases and functionality
Forum rules: Please search to see if a question has already been asked before posting. Please don't ask the same question in multiple forums.
By xanth
#489
Hi,
In my JavaScript code, I'd like to assign a string to a variable. See for following example :
Code: Select all
@@reason_for_trip = "meeting in Lisbon";
Unfortunately, the assignment doesn't seem to work. At the moment, I can only read this variable.
I don't know why, because in the User Manual, it seems to use that way :
cf. trigger : @@TASK_DATE = Date('Y-m-d');
Any idea?
Thanks
Xanth
By pyxel
#490
Hi,

You can't use this syntax in Javascript. The variable @@reason_for_trip must be interpreted by the server, in php code. You can only use it in a trigger.

Regards
By xanth
#491
Hi Pyxel,
Thank you for your answer.

My goal is to access and modify by JavaScript (or by something else ...) value of existing fields created in the Fields List area.

I have tried to use :
JavaScript code :
Code: Select all
document.getElementById("reason_for_trip").value;
But the issue is that, in the HTML file, there is a external link to the XML file (I am not sure) which is :
HTLM code :
Code: Select all
{$form.reason_for_trip}
It seems to come from Perl language.

XML code :
Code: Select all
<reason_for_trip type="text" maxlength="64" validate="Any" size="15" mode="edit">
  <en>Reason for Trip</en>
</reason_for_trip>
It's probably the reason why I can't access the reason_for_trip field.
If it were the case how could I easily modify a field which is declared in the XML file ? How to access this XML file?
Or if there is something more intuitive to use than JavaScript...
Thanks
xanth

The 1Win Clone Script is a pre-built solution that[…]

Aviator Clone Script replicates the renowned Aviat[…]

From converting physical assets into digital asset[…]

🚀 Scopri la potenza di Immediate Evista 2.0 per il[…]