Roope Posted November 11, 2013 Share Posted November 11, 2013 Hello everyone! Little support needed with required only if rules. On latest dev I have a setup with fields price_sold (float) and sold_user (page). I want price_sold to be required if sold_user has some data. If I set condition to sold_user!='' required asterix appends next to price_sold label but I can still save page normally with empty field. If I set sold_user='' there is "Missing required value (price_sold)" error on every save - is sold_user empty or not. Also same with sold_user.count=0/1. Can it be some bug with language modules? Or am I just reading the docs wrong? http://processwire.com/api/selectors/inputfield-dependencies/#example-blank http://processwire.com/api/selectors/inputfield-dependencies/#example-page Link to comment Share on other sites More sharing options...
BUCKHORN Posted November 11, 2013 Share Posted November 11, 2013 Copy your full code so we can see what's going on. Are you doing this in a template? If so, it may be easier to use a module that checks to see if you have a page reference and if so, modify the price_sold to be a required field. Link to comment Share on other sites More sharing options...
Roope Posted November 11, 2013 Author Share Posted November 11, 2013 I'm talkin about field settings at admin setup. Here's my price_sold field input tab (one example I tried to describe earlier): And here what's going on when I edit page using these fields: Link to comment Share on other sites More sharing options...
ryan Posted November 14, 2013 Share Posted November 14, 2013 It sounds like the dependency is working on the front-end (javascript side) but not the back-end (PHP side). So it sounds like a bug–I'll try to duplicate. But since you are on the dev branch and regular updates are made, especially with dependencies being brand new, you might want to get the latest dev branch, just in case this issue was already fixed (though I've worked on so much recently I don't recall offhand if this has been fixed yet or not). Link to comment Share on other sites More sharing options...
Roope Posted November 14, 2013 Author Share Posted November 14, 2013 Thanks for reply Ryan! Unfortunately it's still there. Just tried out latest dev (329388108d5ab0ebe9439cbf7c40be5387d03113). Link to comment Share on other sites More sharing options...
ryan Posted November 16, 2013 Share Posted November 16, 2013 Thanks Roope, I'll take a look at this and see if I can duplicate and find a solution. Link to comment Share on other sites More sharing options...
Roope Posted December 17, 2013 Author Share Posted December 17, 2013 Hello! I just downloaded last dev branch and noticed that this issue still exists. I have project that needs this kind of functionality so I'd like to know is there any other way to validate fields manually by module? Case is that when page dropdown (Pages field) has certain value set, some fields are needed to be required. At the moment this is not possible with field required if settings. Link to comment Share on other sites More sharing options...
ryan Posted December 28, 2013 Share Posted December 28, 2013 I haven't figured this one out yet but on the to-do list before 2.4 is released. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now