Forms displaying error if no result is found. |
04-06-2016, 11:07 AM
(This post was last modified: 04-06-2016, 11:11 AM by PaulD. Edit Reason: Added PS )
Hi,
Not that I know of, there is not auto way of dealing with that. If there is no record found, I would normally show an error of some description, after all, if they are requesting a non-existant record something has gone wrong somewhere. If it is a case of the difference between add or edit, so when adding, clearly no record exists. In that circumstance I just fill the array with blank values. Usually I also have a hidden field to indicate if we are adding or editing too, to decide if we are updating an existing field or adding a new one in the controller on successful form validation. Although often I have different forms for adding or editing, so if editing and no record is found an error screen is shown. Best wishes, Paul. PS You always have to check, if there is a possibility of a query not returning a result, if there is a result or not. (Which is almost always the case, in fact I cannot think of one query where a record is guaranteed to exist.) I also always do the check in the view as well. |
Messages In This Thread |
Forms displaying error if no result is found. - by mydiskarte - 04-06-2016, 10:53 AM
RE: Forms displaying error if no result is found. - by PaulD - 04-06-2016, 11:07 AM
RE: Forms displaying error if no result is found. - by cartalot - 04-07-2016, 01:24 PM
RE: Forms displaying error if no result is found. - by spjonez - 04-09-2016, 08:03 AM
RE: Forms displaying error if no result is found. - by mydiskarte - 04-11-2016, 09:30 AM
|