b-b-a / bba-power

1 stars 0 forks source link

Edit Contract - adjust size of file name box; grey out Status #222

Closed ghost closed 11 years ago

ghost commented 11 years ago

Is the following OK?: site.css line 465 - width: 430px; This makes the box for the file name as wide as fits the window.

Also Can I be a pain and suggest the status is greyed out if no meters or no tenders? (i.e. perhaps? edit.php - delete lines 108-111, insert 75 to grey out status?) (No need to force its content to just new of course)

ghost commented 11 years ago

Its never that simple! - $this->getElement('contract_status')->setAttrib('disabled', 'disabled'); But then the validation fails as the element is not submitted! Does this make sence? Since we force it to new, take the 'required' off and have it set to new if it is not submitted.

shaunfreeman commented 11 years ago

yes does make sense as this is browser specific if you set to disabled the value is not submitted if set to readonly the field is submitted but user cannot alter it.

Is this OK what I have committed?

ghost commented 11 years ago

I had tried that - the problem is that the 2 fields look different - one is disabled and the other cannot be changed (and it is not clear to the user why the status field can't be changed). Is it possible to use the "disabled" and force "no input" (i.e. = '') to be 'new'? At least with disabled the whole thing is greyed out so they know they are not allowed to change it. We don't have to make any changes to the status field - it does work as it was (with new as the only value). I was after using the "disabled" as this is a nicer way of telling users they can't set it but still show them what the value is. (In the normal world disabled fields are passed in via post but in this system the value has to be got from somewhere else. As the field will only be disabled when it is new we can force it to that. Or - add a hidden field with the status value and if the real field is blank [because it is disabled], read the value from the hidden field.)

shaunfreeman commented 11 years ago

this should be how you would like it. disabled select with hidden 'real' value only if no meters or tenders.