Results 1 to 2 of 2

Thread: how to know if textfield is edited

  1. #1
    Sencha User
    Join Date
    Jun 2013

    Default how to know if textfield is edited

    Hello All ,
    This is my first ever post on Sencha.

    I have 2 textfields say 1 and 2 . and an action button.
    instance 1: now if i enter a value in textfield1 and delete it now i enter something in textfield2 say "3" and click on action button , it should consider textfield1's value as 0 and textfield2 as 3 ..
    instance 2: but if i do not take my cursor in either of them and click on button then it should throw an alert.

    so in short i wanna know if the textfield has ever been 'touched'(taken the cursor into) by the user until the action button is clicked
    i tried isDirty() but it didn work for me .
    is there anyway to go about this?


  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL


    isDirty will tell you if the current value does not equal the original value which means it has been edited.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:

    Posts are my own, not any current, past or future employer's.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts