Feature #13018

Pre-fill fields after AJAX call

Added by Matt Rogowski over 7 years ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:


Target version:-


When a field that has to check the requirements of other fields (i.e. Tracker or Status) sends off an AJAX call, it sends back the HTML of the new fields with the new requirements etc, and replaces the fields with the new HTML. Obviously it sends off the current values of existing fields so they are still set when the new fields are replaced, but there are some problems.

- If a user opens a dropdown while the AJAX is loading, when the new fields are replaced, the opened dropdown will suddenly flash away as that element has been replaced
- If you are quick and set another field value, when the AJAX call finishes, that field will revert to its old value, because the current value wasn't sent off in the AJAX call, so the returned HTML doesn't know about the new value you've set.

I propose a few solutions to this:

- Make the AJAX call more obvious - I hardly see the little grey loading bar even though I know it's there and what it's doing, users who don't know it's sending an AJAX call may not even know it's doing anything. If the whole page visibly faded out with a message it was checking permissions etc, users wouldn't even be able to try and change other fields while the AJAX call is loading.
- Don't replace the entire HTML at all. I think it's a bit of a crude way of doing it and could be done much nicer. For instance, if all you're doing is marking whether something is required or not, you could just hide and show the star rather than replacing all the HTML. If other fields may be added/hidden, you could just load them all on the page initially, and hide and show them as required. If you're replacing a select, you could get the current value right before you replace it, which may be different to the value it had when you sent off the request, and set that to the new dropdown, which would solve issue 2 above.

Overall I love the functionality this offers but these issues annoy me even as a more technical user, someone who isnt as technical may not realise why their form values keep disappearing. I hope you'll consider my suggestions to try and make this feature even better than it currently is.

Also available in: Atom PDF