Skip to main content
Participant
May 11, 2010
Question

How to compare a database field and form field and highlight differences

  • May 11, 2010
  • 1 reply
  • 338 views

Hi there,

I have been trying to find a coldfusion function that will help, I have tried comparing two strings but the results of -1 1 or 0 aren't very useful.

I need to compare a database field with a form field and highlight all the differences in the form field in red.

Thanks

Katie

    This topic has been closed for replies.

    1 reply

    Inspiring
    May 11, 2010

    This is a non-trivial process.  Rather than doing a compare, you really are wanting to do a diff.  CF doesn't do this out of the box, but you might want to have a sniff around on Google to see if anyone has implemented anything for CF.

    Some reading:

    http://en.wikipedia.org/wiki/Diff#Algorithm

    --

    Adam