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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:13:24+00:00 2026-06-01T12:13:24+00:00

I have a ZendX_Jquery_Form where I am having a trouble setting placeHolder for a

  • 0

I have a ZendX_Jquery_Form where I am having a trouble setting placeHolder for a select Element.

$month->setAttribs(
        array(
            'required'  =>  TRUE,
            'placeHolder'   =>  'Month'
        ));

I wanted it too look like this:
enter image description here

but all I am getting is thi: enter image description here

On my firebug output html looks like this

<select id="months_at_residence-lengthMonth" placeholder="Month" required="1" name="months_at_residence[lengthMonth]">

I have absolutely no idea why this is not working.

I need help to set this such that when i click on it placeholder text hides.
Just incase this dont work straight using zend I know this can be done using js/css . If I do it with css and javascript how can I achieve this for all select elements ?

Hope the question was clear enough

  • 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-01T12:13:26+00:00Added an answer on June 1, 2026 at 12:13 pm

    Placeholders don’t work with select form element, what you should do instead is to use a default value and disable it as follows:

    $month->addMultiOption('--', 'Month');
    $month->setOptions(array('disable' => array('--')));
    

    This will output:

    <select id="country" name="country" class="valid">
        <option disabled="disabled" label="--" value="--">Month</option>
        <option label="January" value="Jan">January</option>
        <option label="February" value="Feb">February</option>
        // ...
    </select>
    

    Note from W3Schools:

    The placeholder attribute works with the following input types:
    text, search, url, tel, email, and password.

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

Sidebar

Related Questions

I have a Zend_Form with file element like this: ->addElement('file', 'image', array( 'required' =>
have such zend query: $select = $this->_table ->select() ->where('title LIKE ?', '%'.$searchWord.'%') ->where('description LIKE
I have one select box with options and I am using jQuery Chosen on
I have included Zend_Form_Element_Hash into a form multiplecheckbox form. I have jQuery set to
I am pretty new to the zend framework and the JQuery helper. I have
We have a Zend application that has these following modules: Users Shop etc... Front
I have a Zend Framework project using version 1.10.8 with Doctrine 1.2.4.I use Zend_Auth
I have a Zend_Form_Element_Multicheckbox and I want to put some of its elements in
I have two Zend Date objects to work with: $now = Zend_Date::now(); $sessionStart =
I have installed zend server on my mac and i think that there are

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.