Announcement

Collapse
No announcement yet.

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

Collapse
X
  • 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:
    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.

  • #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.

    onload:

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

    See the picture.

    2015-04-27_10-14-12.jpg
    Best regards,
    Thomas Soares.
    ScriptCase International.

    Email: t.soares@scriptcase.net
    Visit our Blog: http://www.scriptcase.net/blog/
    Visit out fan page: http://www.facebook.com/Scriptcase

    Comment


    • #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)

      Comment

      Working...
      X