Jump to content

Required only if... and conditions with Pages field


Roope
 Share

Recommended Posts

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?



Link to comment
Share on other sites

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

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

  • 1 month later...

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

  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...