den1sa
Forum Replies Created
-
Hi Andrew,
Thank you for your response.
Yes this is what I am trying to achieve. In my code it show the initial selections, then the two blocks of code below that are for each selection. Can anyone show me where i am going wrong as i need to get around the issue referencing animal_list. It appears that this needs to be a unique name.
$fields[] = new PMProRH_Field( "animal_list", "select",
Any help will be greatly appreciated.
Denis
Firstly, thank you Michael.
I am trying to get my head around how i would implement this, but I feel i have hit a brick wall.
The first part of my script should list two types;
- Wild
- Pets
The second part of the script should list the values based on the initial selection. for example,
If Wild is selected then list Tiger, Monkey, Elephant, Giraffe in the animal_list dropdown.
If Pets is selected then list Cats, Dogs, Budgies, Rabbits in the animal_list dropdown.
This is as far as i got,
The important bit is that no matter what you select from ‘animal_type’ Wild or Pets, the same field ‘animal_list’ is populated.
<?php $fields[] = new PMProRH_Field( 'animal_type', 'select', array( 'required' => true, 'profile' => false, 'levels' => array(7), 'label' => 'What type of animal are you registering?', 'hint' => '(You can select a more specific animal type in the main profile page after registration)', // display a hint under field 'options' => array( '' => 'Please select animal type', 'Wild'=> 'Wild', 'Pets'=> 'Pets', ) ) ); $fields[] = new PMProRH_Field( "animal_list", "select", array( "options" => array( '' => 'Please select animal type', 'Tiger'=>'Tiger', 'Monkey'=>'Monkey', 'Giraffe'=>'Giraffe', ), "label" => "Wild Animal Types", "levels" => array(7), "profile" => true, "required" => true, "depends" => array( array( "id" => "animal_type", "value" => "Wild" ) ) ) ); $fields[] = new PMProRH_Field( "animal_list", "select", array( "options" => array( '' => 'Please select animal type', 'Cats'=>'Cats', 'Dogs'=>'Dogs', 'Rabbits'=>'Rabbits', ), "label" => "Pet Animal Types", "levels" => array(7), "profile" => true, "required" => true, "depends" => array( array( "id" => "animal_type", "value" => "Pets" ) ) ) );
When I run this code, upon opening the page and without any selection from the animal list dropdown, I see ‘Pet Animal Types’ shown. When I select ‘Wild’ only ‘Pet Animal Types’ shown. When I select ‘Pets’ both ‘Wild Animal Types’ and ‘Pet Animal Types’ are shown. I only want the dropdown shown corresponding to the initial selection.
The only way I can get this to work is to make each animal_list unique. So Wild is ‘animal_list’ and Pets is ‘animal_list2’. This is not a solution, as I want the animal_list field populated whether the user selects Wild or Pets.
I hope i have explained this clearly.
Can someone please help me achieve this.
Thanks in advance.
Denis
- This reply was modified 1 year, 7 months ago by den1sa.
- This reply was modified 1 year, 7 months ago by den1sa.
- This reply was modified 1 year, 7 months ago by den1sa.
- This reply was modified 1 year, 7 months ago by den1sa.
- This reply was modified 1 year, 7 months ago by den1sa.
- This reply was modified 1 year, 7 months ago by den1sa.
- This reply was modified 1 year, 7 months ago by den1sa.
Hi, sorry I have not been clear.
Role is just a normal field and not related to role in WordPress. We could call it Job Position instead.
Rewritten would look like this…
Hi,
I got my inspiration from this link, but i cannot seem to get it working.
I have a dropdown field called ‘Job Position’ which lists all Job Positions available. However, if I do not have the Job Position listed in the dropdown, I want to offer the users the ability to add the Job Position manually.
So i have two fields:
- Job Positions (dropdown)
- Enter Job Position if unavailable (text)
Now what I want to do is to have one dropdown in the search/filter page that is populated by the two fields above (‘Job Positions’ and ‘Enter Job Position if unavailable’).
Can anyone tell me if this is possible and if so, how?
Thanks in advance,
Denis
Apologies, thanks for pointing this out. I have now copied it to the Paid Membership Pro forum.
- This reply was modified 1 year, 7 months ago by den1sa.
I am mainly asking if i can show/hide fields on the filter/search page, based on what is selected.
Can anyone help?
- This reply was modified 1 year, 7 months ago by den1sa.
Hi Vivalis,
I am trying to do this also. Can you share your solution?
Thanks.
Denis
I have worked on the solution some more and now have the form fixed. Now when you select Car from the Vehicle List, the Vehicle Type list the car types. This also now works in the filter list.
Thank you MissVeronica for this solution, however, due to the structure of my data, rather than having one field that contains all the vehicle types, I have a separate field per vehicle type. So, one that contains all Car Types, another that contains all Van types, and so on…
So my question is how do I hide all the Vehicle Type fields and only show the correct Vehicle Type field (e.g. Car Types or Van Types, etc) based on the selection in the Vehicle List?
I have put everything in place.
When I go to the filter page and select Car, the dropdown doesnt filter to Car types. Do you know what I may have done wrong?
I have the Vehicle List (parent) which is static and always should appear. The variable fields are Cars, Boats, Planes, etc… and should only show up depending what value has been selected in the parent.
Maybe you can help me. Thanks.
Thank you. I will give this a go.
Thank you both for your quick responses.
Now that i have added the code to the Code Snippets plugin, how do i relate this to the Member Directory page called ‘All Services’ that corresponds to this shortcode [ultimatemember form_id=”6149″] ?
Does anyone know of a solution to the slider issue on mobiles or a workaround such as converting the slider to two separate text fields, one for the from age and the other the to age?
Thanks.
Did you manage to see the issue?
Yes. The theme is called Julia.
You can view the issue here.
I wonder if there is a plugin to allow me to choose what filter control type i want to use. Say dropdowns, sliders, text boxes, etc.