I have a form with a number of combos created with dhtmlXComboFromSelect.
The form posts back to the server and if there are errors re-loads the form with populated values entered.
However I am struggling as to how to handle the case where a new value has been entered and getting the field correctly populated with the previously entered value AND setting the FIELD_new_value to TRUE.
I can hack it by adding the new value as an option to end of the generated select, but that doesn’t resolve the FIELD_new_value issue. I can use javascript to set that to TRUE, but then the issue is if that field gets focus and then blurs FIELD_new_value will be reset to FALSE as it’s recognised the current value is an ‘original’ value.
So my solution doesn’t really work and feels really hacky. I’m sure there must be a better solution to it, is there?
Could you please provide us complete demo including all correspondnig js/css files?
Please also add information regarding current and expected behaviour.
There’s a small amount of PHP in there to mark the previously selected value as selected.
The form just posts back to itself. If a existing option is chosen from the list it can be shown as selected after the post back. If a new value is entered then this cannot be shown in the select list.