Jump to content

Required only if... and conditions with Pages field


Recommended Posts

Posted
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?



Posted

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. 

Posted

I'm talkin about field settings at admin setup.

Here's my price_sold field input tab (one example I tried to describe earlier):

post-1087-0-94726200-1384205197_thumb.pn

And here what's going on when I edit page using these fields:

post-1087-0-69647300-1384205195_thumb.pn

Posted

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). 

Posted

Thanks for reply Ryan! Unfortunately it's still there. Just tried out latest dev (329388108d5ab0ebe9439cbf7c40be5387d03113).

  • 1 month later...
Posted

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.

  • 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
  • Recently Browsing   0 members

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