Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

davy_yg's avatar
Level 27

Create Textbox inside dropdown

Hello,

Please check this link: https://drive.google.com/file/d/1XOt8wY7gLUdRM0ollkdEQIKQKG5wlzZl/view?usp=sharing

I basically trying to place a textbox in the dropdown box. The textbox is for custom variant that you enter.

It is for product variant such as:

  1. color: red, white, blue, etc.
  2. size: S, M, L, XL

This is what I have tried:

	  Tipe Varian 1: 

                  <select name="tipe_varian" id="cars">
                      <option value="warna">Warna</option>
                      <option value="ukuran">Ukuran</option>
                      <option value=""></option>
                      <input type="text" name="tipe_custom">
                  </select>

but It doesn't work.

Any idea how?

Thanks in advance.

0 likes
3 replies
Sinnbeck's avatar

You cannot do that. Use a Javascript lib like select2 that allows stuff like this

Please or to participate in this conversation.