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 8961599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:55:51+00:00 2026-06-15T15:55:51+00:00

Using codeigniter to generate form. The form has a form_dropdown() <div class=control-group> <?php foreach

  • 0

Using codeigniter to generate form. The form has a form_dropdown()

  <div class="control-group">
      <?php 
        foreach ($clients as $client => $clientValue) {
           $option[$clientValue['clientName']] = $clientValue['clientName'];
        }
        echo form_label('Client Name:', 'client');
        echo form_dropdown('client', $option);
      ?>
</div><!-- /control-group -->

Output

<select name="client">
<option value="Mike">Mike </option>
<option value="Sissel Bygton">Sissel Bygton</option>
<option value="Calli Crass">Calli Crass</option>
</select>

Javascript/jQuery

var clientName = json.selected_gallery[0].clientName; //clientName retrieved from DB

//alert box to confirm clientName for this example lets say it's Mike
alert(clientName)//output Mike

//Client Select name
$('select.client').val(clientName);

From what I’ve gathered through other Q&A, I would think that my jQuery would do the trick. Am I leaving something out?

  • 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-15T15:55:53+00:00Added an answer on June 15, 2026 at 3:55 pm
    <select name="client">
    

    Selector supposed to be

    $('select[name="client"]').val(clientName);
    

    If you want to access it using a class then

    <select class="client">
    

    Selector for the above is

    $('select.client').val(clientName);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the CodeIgniter PHP framework. I have a simple form that has an
I'm using the CodeIgniter calendar class to generate an availability calendar. I use a
I'm using the dompdf plugin for codeigniter: http://codeigniter.com/wiki/PDF_generation_using_dompdf/ to generate pdfs from a form.
I am using CodeIgniter to upload some files through a form. I know how
I'm using codeigniter framework and I'm getting this error when I've submitted my form:
I am using Codeigniter framework and I have a form with input fields. When
I'm using CodeIgniter (a PHP framework) to build an app, and I have an
I am using codeigniter and its pagination class. It works perfectly and it looks
In codeigniter, as you know, a page of the form: /class/function/ID , where class
I am using codeigniter. I generate a custom error message from the errors which

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.