Jump to content


Photo

HTML writeable <Select> problem


Best Answer Psycho, 28 February 2014 - 04:10 PM

I have HTML form

<select id="abe" name="abe">'.$list.'</select>

how do i make it writeable ? is there any html tags which its functionality like combined <select> and <input>?

 

No. You would have to use JavaScript to do that. The JQuery UI framework has some prebuilt solutions that might meet your need. Here is one: http://jqueryui.com/...te/#custom-data

 

Or, if you don't want to complicate things, the common standard is to have a select list with the current options as well as a "Custom" option. Then have a text field for the user to enter that custom value.

Go to the full post


  • Please log in to reply
2 replies to this topic

#1 Fiqhi

Fiqhi

    Member

  • Members
  • PipPip
  • 16 posts

Posted 28 February 2014 - 03:35 PM

I have HTML form

<select id="abe" name="abe">'.$list.'</select>

how do i make it writeable ? is there any html tags which its functionality like combined <select> and <input>?



#2 Psycho

Psycho

    Advanced Member

  • Gurus
  • 10,752 posts
  • LocationCanada

Posted 28 February 2014 - 04:10 PM   Best Answer

I have HTML form

<select id="abe" name="abe">'.$list.'</select>

how do i make it writeable ? is there any html tags which its functionality like combined <select> and <input>?

 

No. You would have to use JavaScript to do that. The JQuery UI framework has some prebuilt solutions that might meet your need. Here is one: http://jqueryui.com/...te/#custom-data

 

Or, if you don't want to complicate things, the common standard is to have a select list with the current options as well as a "Custom" option. Then have a text field for the user to enter that custom value.


The quality of the responses received is directly proportional to the quality of the question asked.

I do not always test the code I provide, so there may be some syntax errors. In 99% of all cases I found the solution to your problem here: http://www.php.net

#3 Augury

Augury

    Advanced Member

  • Members
  • PipPipPip
  • 98 posts

Posted 03 March 2014 - 10:10 AM

foreach($list as $op)  $optionstring .= '<option value="'' . $op . '">' . $op . '</option>';

 

<select id="abe" name="abe">' . $optionstring . '</select>

 

if you have an keyed array

 

foreach($list as $val => $op)  $optionstring .= '<option value="'' . $val . '">' . $op . '</option>';






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com