Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8399497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:19:15+00:00 2026-06-09T21:19:15+00:00

I have an add form that allows me to add the specific field into

  • 0

I have an add form that allows me to add the specific field into the database and one of my options is a dropdown menu so that I can set the form type:

I now in the process of creating the edit page and I have called the other values as $field->name etc but how would I call $field->type to set the specific value for the dropdown menu?

My Add view is:

<label for="edit_fields_type">Type: </label>
<select name="edit_fields_type" id="edit_fields_type">
    <option value="">Please Select</option>
    <option value="input" <?php echo set_select('edit_fields_type','input', ( !empty($fieldType) && $fieldType == "input" ? TRUE : FALSE )); ?>>Input</option>
    <option value="textarea" <?php echo set_select('edit_fields_type','textarea', ( !empty($fieldType) && $fieldType == "textarea" ? TRUE : FALSE )); ?>>Text Area</option>
    <option value="radiobutton" <?php echo set_select('edit_fields_type','radiobutton', ( !empty($fieldType) && $fieldType == "radiobutton" ? TRUE : FALSE )); ?>>Radio Button</option>
    <option value="checkbox" <?php echo set_select('edit_fields_type','checkbox', ( !empty($data) && $data == "checkbox" ? TRUE : FALSE )); ?>>Check Box</option>
</select>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:19:17+00:00Added an answer on June 9, 2026 at 9:19 pm

    So what you want from the form helper is the third parameter of form_dropdown() which allows you to specify the selected item. Possibly:

    $this->load->helper('form');
    $options = array('input' => 'Input','textarea' => 'Text Area','radiobutton' => 'Radio Button','checkbox' => 'Checkbox',);
    echo form_dropdown('edit_fields_type', $options, $field->type);
    

    Where $field->type is wherever you have the selected value in your model.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bound form in microsoft access that allows a user to add
I have a dynamic form that users can add/delete sets of input fields. I
I want to have a Form that can Add or Delete TextFields. I was
I have a form that allows a user to add an unlimited number of
I have an events form that allows someone to add a new event. An
I have a form that allows the user to add as many upload forms
I have a form that allows users to refer friends. I want to add
I have a form that allows users to refer friends. I want to add
I have a product registration form that allows the user to add additional product
I have a form that allows the user to add information an their leisure.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.