Home » Custom Posts and Fields » Dropdown Field
Dropdown Field
How to Add a Dropdown Field in QuickBuildWP?
Step 1: Access Field Groups
- Navigate to QuickBuildWP in your WordPress dashboard.
- Click on Field Groups.
- Select the form that you want to modify.
Step 2: Edit the Form
- Locate the form where you want to add the dropdown field.
- Click the Edit link.
- For example, let's add a
service_timeline
field to the Business Query form. - Click Edit on the Business Query form.
Step 3: Add a Custom Dropdown Field
- Scroll to the Custom Fields section.
- Click the Add button.
- Select Dropdown as the Type.
- Choose Basic Information as the Meta Box.
- In the Label field, enter: How soon would you like this service?
- Set the Field Name to
service_timeline
. - Choose Validation Rules as per your requirements.
Step 4: Add Dropdown Options
- In the Options field, enter the following JSON format:
{
"options": [
{ "name": "ASAP", "value": "asap" },
{ "name": "1 to 2 Weeks", "value": "1_2_weeks" },
{ "name": "3 to 4 Weeks", "value": "3_4_weeks" },
{ "name": "Longer than 4 Weeks", "value": "longer_than_4_weeks" }
],
"options_detailed": 1
}
-
This will add four dropdown options: ASAP, 1 to 2 weeks, 3 to 4 weeks, or longer than 4 weeks.
-
Ensure the JSON is correctly formatted before saving.
Step 5: Save Changes
- Click the Update button to save your changes.
- Your dropdown field is now added successfully to the form.
Step 6: Test the Dropdown Field
- Open the Business Query form.
- Verify that the dropdown field appears with the correct options.
- Submit a test form to ensure validation and data submission work as expected.