Welcome Guest, Not a member yet? Register   Sign In
required_with Validation Rule works on inserts but not updates
#1

I have a form where a select menu is disabled by default.  It's enabled when a when a checkbox is checked and disabled when the checkbox is uncheck using a bit of javascript.  I would like this select menu to be required only when the box is checked  The required_with validation rule is perfect for this and it works great on inserts.  However, it does not work on updates.  It's like the required_with rule somehow vanished with the update query.  The validation is taking place in the model before insert and update queries.  Both insert and update controller methods use the same view, so the HTML form is essentially the same.  I inspected the POST data when both inserting and updating and it is exactly the same.  The only difference is whether the data is being inserted or updated in the database.  Am I doing something wrong?  Is this a bug?
Reply


Messages In This Thread
required_with Validation Rule works on inserts but not updates - by mlurie - 10-10-2020, 08:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB