Forum: Xprofile Fields

This forum is closed for new topics. However, you can still search for a solution in the old topics. For technical support related to the Xprofile Fields premium extension please open a new premium support ticket.

[Not resolved]Conditional form fields

Forums Xprofile Fields Conditional form fields

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #53319
    sanis
    Member

    Hello Eyal,

    I use Geo My Wp with Buddypress plugin. Is there a way to add in the search form conditional fields? For example if option x is chosen then one more field appears, if not then it remains hidden.

    Thank you!!

    #53371

    Hello Sanis,
    There is not such feature out of the box. Depends on your needs, you can mosts likely create something like that using Jquery. You can probably add to the form all the fields that you will be using. Then with Jquery you can hide them all except for the first field. Then, with Jquery again, you can hide and show other fields based on what the user choses in the fields that are already visible.

    I hope that makes sense.

    #53435
    sanis
    Member

    Hello Eyal,

    is it possible to give me an example? I add a new directory in my child theme under the name “js” and in that directory I added the file “gmw-form.js”. In the file I drop the code:

    but nothing changed…

    Thank You!!

    Private Content Hidden
    #53475

    Hi Sanis,
    Unfortunately, I don’t have an example for this scenario. But it seems that the functions above should work or at least your are in the right direction. Except for gmw-fl-form-xprofile-fields-1(); which I don’t know what that is.

    What I think happens is that the file gmw-form.js does not load at all. The file won’t load unless you enqueue it using wp_enqueue_script().

    What you can do is include the script in the functions.php ( instead of in its own file ) file and execute it using wp_footer action. For example:

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.