PDA

View Full Version : DisplayField and FormPanel questions...



mjoksa
26 Aug 2009, 9:01 PM
Hello,
I tried to fiend solution for issues mentioned below, but had no luck on forum, so I decided to post it. I have two questions:
1. Is there any way to post DisplayField value when form is posted?
2. How to get form field which has foccus?

Just to elaborate: I have FormPanel with three fields (one TextField, one TextArea and one DisplayField). When form is posted no value from DiaplyField is posted (question 1) and I just couldn't find the way to get form field with user focus (qusestion 2).

Cheers

steffenk
26 Aug 2009, 11:33 PM
1) DisplayField isn't for submitting, it's only for Display - that's why it have this name ;)
2) in DOM there is an "onfocus" event which you could use.

Condor
27 Aug 2009, 12:32 AM
1) Try the StaticTextField user extension or use a read-only TextField (add styling to make it look like plain text).
2) There is no cross-browser way to find the focused element. You will have to attach focus and blur events to all fields and remember which field received the focus last.

mjoksa
27 Aug 2009, 2:15 AM
10x for replies