Announcement

Collapse
No announcement yet.

Flagging the changed input field

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Flagging the changed input field

    Is there a way to flag which input field was changed? I am guessing it would have to be some JS?

    System_content, displaying table data, so rows and columns. Rows are grouped together, so when I need to change a value, all the rows in a group are enabled with an INPUT field. The problem is when I am looping through the array structure when passed to _Validate or _Update, I need to know which field had been changed.

    Just to create a picture, if needed, imagine 3 rows of 3 columns of values, a button is clicked and the table turns into 9 text input fields. If I change the value in row 2 col 3, I need that field flagged so I can do something when I reach that position in the loop.

    Thanks,

    Scott


    What help do you need today!
    Interactive Design Solutions http://www.southbound.com
    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
    My T-shirt Collection is mostly MivaCon T-shirts!!
    Competitive Rates, Popular Modules, and Integrations:
    Product Copy | AutoBaskets | Waitlist Integration| Wholesale Integration

    #2
    In cases like that, I generally create a hidden field for each input, to save the previous value. Then in my Module_XXX_Update function, I compare the old values to the new ones. Kind of a brute-force solution, but it works, and it doesn't require any Javascript.
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    Comment


      #3
      I'll give that a whirl, Thanks Kent.

      Scott
      What help do you need today!
      Interactive Design Solutions http://www.southbound.com
      MivaMerchant Business Partner | Certified MivaMerchant Web Developer
      My T-shirt Collection is mostly MivaCon T-shirts!!
      Competitive Rates, Popular Modules, and Integrations:
      Product Copy | AutoBaskets | Waitlist Integration| Wholesale Integration

      Comment

      Working...
      X