Set also input and select fields to read only on form disable.

This commit is contained in:
Martin Edenhofer 2015-06-03 09:20:00 +02:00
parent 5f2b39af57
commit 6c6f3fba7b

View file

@ -2479,12 +2479,16 @@ class App.ControllerForm extends App.Controller
lookupForm = @findForm(form) lookupForm = @findForm(form)
if lookupForm if lookupForm
App.Log.notice 'ControllerForm', 'disable...', lookupForm App.Log.debug 'ControllerForm', 'disable form...', lookupForm
lookupForm.find('button').attr('disabled', true)
lookupForm.find('[type="submit"]').attr('disabled', true) # set forms to read only during communication with backend
lookupForm.find('[type="reset"]').attr('disabled', true) lookupForm.find('button, input, select').attr('readonly', true)
# disable additionals submits
lookupForm.find('button.btn').attr('disabled', true)
else else
App.Log.notice 'ControllerForm', 'disable item...', form App.Log.notice 'ControllerForm', 'disable item...', form
form.attr('readonly', true)
form.attr('disabled', true) form.attr('disabled', true)
@enable: (form) -> @enable: (form) ->
@ -2492,12 +2496,16 @@ class App.ControllerForm extends App.Controller
lookupForm = @findForm(form) lookupForm = @findForm(form)
if lookupForm if lookupForm
App.Log.notice 'ControllerForm', 'enable...', lookupForm App.Log.debug 'ControllerForm', 'enable form...', lookupForm
lookupForm.find('button').attr('disabled', false)
lookupForm.find('[type="submit"]').attr('disabled', false) # enable fields again
lookupForm.find('[type="reset"]').attr('disabled', false) lookupForm.find('button, input, select').attr('readonly', false)
# enable submits again
lookupForm.find('button.btn').attr('disabled', false)
else else
App.Log.notice 'ControllerForm', 'enable item...', form App.Log.notice 'ControllerForm', 'enable item...', form
form.attr('readonly', false)
form.attr('disabled', false) form.attr('disabled', false)
@validate: (data) -> @validate: (data) ->