No announcement yet.

Error with macro sc_changed for field type text with enter at end.

  • Filter
  • Time
  • Show
Clear All
new posts

  • Error with macro sc_changed for field type text with enter at end.

    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:

    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.

  • #2
    I simulated your problem on my local machine and not getting results similar to yours.

    I assigned a field Created to a value of another field and both have the same value and number of characters.


    {teste} = {Title};
    echo "title = ".var_dump({Title});
    echo "title = ".var_dump({teste});

    See the picture.

    Best regards,
    Thomas Soares.
    ScriptCase International.

    Visit our Blog:
    Visit out fan page:


    • #3
      The problem is when you press enter to field type text multiline and the cursor continue the next line.
      Example: Armagedon (And Press enter)