PDA

View Full Version : formBind, monitorValid + image as submit button



taelo
30 Dec 2010, 9:11 AM
Is it possible to disable an image, that is being used as a form submit button, on a form that is not valid?

slemmon
30 Dec 2010, 10:24 AM
mask it perhaps and have it mask/unmask in a function under the form's clientvalidation event listener?
Don't believe you'd use formBind in this case. Just the listener on clientvalidation.

taelo
30 Dec 2010, 11:20 AM
I guess the other option could be to use actual form buttons and apply images to them, but that's not really want I want. Thanks for the suggestion.

slemmon
30 Dec 2010, 11:56 AM
Looks like monitorValid fires constantly alerting to clientvalidation whether the form is valid or not. You might even be able to have your submit image wrapped in an Ext.Element and set that element's relayEvents property up to listen for its parent form's clientvalidation event and respond to it by masking/unmasking itself.

Not sure if that helps, but I just learned about relayEvents the other day and have found it opens some convenient doors.