Log message #4174549

# At Username Text
# Jan 21st 2019, 18:45 ricksaccous or you could prob write in jquery a script that on page load, go to first tab with errors in it
# Jan 21st 2019, 18:44 jhall right
# Jan 21st 2019, 18:44 ricksaccous because it could get messy if there are errors across tabs
# Jan 21st 2019, 18:44 ricksaccous you could just resort to displaying errors as flash messages
# Jan 21st 2019, 18:44 jhall ah ok
# Jan 21st 2019, 18:44 ricksaccous but if you wanted
# Jan 21st 2019, 18:44 ricksaccous no i was saying based on if it has x error make x tab active
# Jan 21st 2019, 18:44 ricksaccous however it would be weird if they made errors in two different tabs
# Jan 21st 2019, 18:44 jhall like a flash message?
# Jan 21st 2019, 18:43 jhall oh and display them at the top?
# Jan 21st 2019, 18:43 ricksaccous and based on that show active tab
# Jan 21st 2019, 18:43 ricksaccous in that case you can probably just do getErrors() or something
# Jan 21st 2019, 18:43 ricksaccous oh
# Jan 21st 2019, 18:42 jhall I basically have a tab page style element which by default is not active, so when I attempt to save my entity the client is flagging a field that is missing however is not currently visible
# Jan 21st 2019, 18:33 ricksaccous then you could give it a unique class and insert stuff with jquery if you wanted to
# Jan 21st 2019, 18:33 ricksaccous unless this was for edge cases and not all error messages
# Jan 21st 2019, 18:25 jhall okay
# Jan 21st 2019, 18:24 ricksaccous if you worked for me and insisted on inserting stuff with jQuery I would fire you on the spot, no questions allowed
# Jan 21st 2019, 18:24 ricksaccous formTemplates would be the correct way rather than inserting stuff with jQuery
# Jan 21st 2019, 18:21 ricksaccous so unless you are doing something fancier than inserting stuff there's probably no point
# Jan 21st 2019, 18:21 ricksaccous in that case you could prob just insert with PHP though
# Jan 21st 2019, 18:21 ricksaccous or whatever
# Jan 21st 2019, 18:21 ricksaccous you could prob just give it a class if it has an error and have jquery insert something based on that class
# Jan 21st 2019, 18:20 jhall whats the flow if I want to do something conditional in jquery for an entity field error? So if a field has an error I want to execute some jquery code
# Jan 21st 2019, 17:43 jhall ok
# Jan 21st 2019, 17:43 ricksaccous there's something like that yes
# Jan 21st 2019, 17:43 jhall there has got to be an isnumeric right?
# Jan 21st 2019, 17:43 ricksaccous there is a section near the bottom that linkds to the validation methods
# Jan 21st 2019, 17:43 jhall yeah
# Jan 21st 2019, 17:43 ricksaccous @jhall Validation?
# Jan 21st 2019, 17:42 jhall obviously my zip code can't be aaa
# Jan 21st 2019, 17:42 jhall It must be Monday because I don't see anywhere in the documentation it discusses how to restrict a field to numbers like say its a zip code field
# Jan 21st 2019, 16:16 neon1024 `$unknown instanceof \App\Model\Entity\Example`
# Jan 21st 2019, 16:11 jhall ok
# Jan 21st 2019, 16:11 ricksaccous you can check if the object implements entityInterface or whatever it is
# Jan 21st 2019, 16:11 jhall ah let me check that out
# Jan 21st 2019, 16:10 ricksaccous instanceof is the basic php function you want
# Jan 21st 2019, 16:09 ricksaccous let me see
# Jan 21st 2019, 16:09 ricksaccous if you are not sure at a given time if it will be an object or not
# Jan 21st 2019, 16:09 jhall ok
# Jan 21st 2019, 16:09 a.didier basic php function but it give lots of details