January 29, 2015 at 1:40 am #35243
Jie FengMemberPost count: 7
1. can i display a form in a template file (eg: category.php) using php code? < ?php>< ?>
2. so i created a form which allows people to summit pc info. It consists of dropdowns for taxonomy and terms.
dropdown menu A for custom taxonomy (Acer, IBM, DELL) /hardcoded the value for this dropdown
dropdown menu B for Acer taxonomy terms. (Acer has PC1, PC2, PC3)
dropdown menu C for IBM taxonomy terms. (IBM has PC11, PC12, PC13)
dropdown menu D for DELL taxonomy terms. (DELL has PC111, PC112, PC113)
so A would display, and dropdown B C D would be hidden by default. If user selects a Acer from dropdown A, then the corresponding Acer dropdown would appear, and user could select a term there.
This works well when user create new post. and i did all this from the drag and drag UI.
My question is, to make user experience better,
when user is viewing the taxonomy-term page (eg: Acer-PC1.php), i want to show the same form, but since i already know what the taxonomy and term are (Acer and PC1)
can I have the dropdown A and B automatically populated with the selected value ‘Acer' and ‘PC1'? so user does not have to manually select them?
if so could you please provide some simple code? thanks!January 29, 2015 at 6:07 pm #35319
We can help you about making the form. But we can not help you about displaying the data. Because displaying things depends on themes and we do not provide support in such case.
Thank you 🙂January 30, 2015 at 3:48 am #35344
Jie FengMemberPost count: 7
1) okay whats the code for showing the form in php code?
say using short code i would use [wpuf_form id=”2541″], but inside a single.php page,
how do i call the form using < ?php ... ?> code?
2) I am not asking for displaying the data in specify.
I am asking if there is a way to change a dropdpwn selected value programatically, maybe using hook like wpuf_add_post_form_top and change settings array?
Gravity form has a feature which allow you to set dropdown selected value from URL parameters,
say if the url is http://www.mysite.com/myform?DropdownID1=Acer&DropdownID2=PC1
then the form renders and dropdown1 would have Acer as selected value, and dropdown2 would have PC1 as selected value.
That's quite helpful. Does your plugin has similar feature? thanksJanuary 31, 2015 at 5:36 pm #35421
I have to discuss with our developer team. They are now in weekend. I will come back to you tomorrow with the feedback of our developer team.
Thank you 🙂February 1, 2015 at 12:04 pm #35451
1. You can use this code to show the form-
<?php echo do_shortcode( $content ) ?>. You can know more about this from here- http://codex.wordpress.org/Function_Reference/do_shortcode
2. We do not have such kind of feature right now. I will notify to our developer team about this feature. Hope they will think about it to implement.
Thank you 🙂
The topic ‘form and dropdown questions’ is closed to new replies.