craphunter
craphunter

Reputation: 981

sfWidgetFormInputText with dropdown menu

I have an input field like this in lib/form:

'zipcode' => new sfWidgetFormInputText(array(), array('size' => '40', 'maxlength' => '100', 'value' => $t,
         //   'onblur' => "if(this.value == '') { this.value='$t'}",
            'onfocus' => "if (this.value == '$t') {this.value=''}",
            'choices' =>  array('c' => '', 'm' => '12345', 'f' => '98765')
        )),

choices option doesn't work. Is there any option when I click into the zipcode that a dropdown list with some zipcodes appear?

Upvotes: 0

Views: 416

Answers (1)

Maerlyn
Maerlyn

Reputation: 34107

There's no standard HTML field to do what you want. You can either:

  • use a simple text input
  • use a dropdown list (select)
  • use some javascript to somehow combine the two (also known as autocomplete)

Upvotes: 1

Related Questions