Highlighted

Field Access

Avatar

Guest

04-06-2008

Is there a way to set the text in a field so that text can be added to the field, but not removed? IE if i type ABC into a field someone can add DEF, but cant remove ABC.



Thanks

Replies

Highlighted

pguerett

05-06-2008

You can use the command xfa.event.prevText to tell you what was in the field before and the command xfa.event.newText to tell you what is in the field now. Then you will have to compare the two results (the newText will contain whatever is in the field at this time not just the chars that were added) and return the value back into the field that you want. I would use the change event and create another hidden field to hold the result while the user is working on your field. On the exit event you could put the contents of the hidden field back into the field that you want (you need to do this because you cannot change the content of the field you are working on (a focus thing)).



Make sense?