Hello, i am getting un problem with a form, I do not know if is is SC or i have problems with my code:
I have a form type one record, i need to compare the value orginal of some fields with the current value. This value is compared with i click a button type php.
First All, i have a field {original_field} type text multineline and i Create a ATTRIBUTE: {copy_field}, then in Event on Load i asign the original value to this field:
{copy_field} = {original_field}
The button has next code:
if (strcmp({copy_field} , {original_field}) !== 0)
{
Echo “Field have been changed”;
}
Then , when i open the form with a previus record saved and i do not modify the record and clicked on button i get the message: “Field have been changed”.
I do not know why the compation is not equal.
I tested the code with:
if ({copy_field} != {original_field})
{
Echo “Field have been changed”;
}
if (sc_changed({original_field}))
{
Echo “Filed have been changed”;
}
But i get same problem.
I tested both fields:
var_dump({original_field});
var_dump({copy_field});
The result was:
string(13) "This a test " string(12) "This a test "
*** I found out what the problem: If the Text entered have an ENTER the comparasion is not equal:
and the macro sc_changed fail too.
I think is a BUG for Team SC can fix it.