how to add text area when i select any option from select option

shakil

I have one condition where I want to add text area when I select any option from select option. I have 4 to 5 options in my select box and I want one text area to be added when I select any option from my select box.

Here is my html:

<select name="menu-114" class="wpcf7-form-control wpcf7-select" aria-invalid="false">
   <option value="Select Category" selected="selected">Select Agent Name</option>
   <option value="Option 1">Mr. abc</option>
   <option value="Option 2">Mr. abc</option>
   <option value="Option 3">Mr. abc</option>
</select>
<textarea></textarea>

I want to add the textarea when I select any option from above select box.

See my fiddle

jcuenod

I can't think why you would want to but here's how I would do it:

Listen for the change event on your select element and use $.appendTo

$(document).on('change', 'select[name=menu-114]', function(){
    $("<textarea>").appendTo(".agent_select_wrap");
    //$(this).val() will return the value attribute of the select
});

Here's a working fiddle

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to update any text filed when the user is select an option from a dropdown-menu?

From Dev

How I get the text instead value from a select option in CodeIgniter

From Dev

How can i remove HTML nbsp tags from select options when assigning the text of option to hidden input

From Dev

How do I update an Ember.Select when I add a new option?

From Dev

How do I update an Ember.Select when I add a new option?

From Dev

How to select any random menu/option from div tag?

From Dev

In Javascript how do I add a new option into Html Select so inserted based on alphabetical value of text

From Dev

display select option from database when select option change

From Dev

Add custom option (text + value) in a select tag

From Dev

Add custom option (text + value) in a select tag

From Dev

Any option for calculation from select value

From Dev

How to display only part of the option text in a select when it is not dropped down

From Dev

How can I add a disabled option when populating a select with Vue.js v-for

From Java

How to select an option from dropdown select

From Dev

How can I hide an option of a select by it's text value?

From Dev

How can I add a <select> option using jquery?

From Dev

How can I add Options to a Select after a specific Option in jQuery?

From Dev

HTML - changing color in text area from an option inside of a select box generated from mysql

From Dev

jQuery typeahead stops working when I select an option from the dropdown

From Dev

How to add option fetched from the database to the end in select php

From Dev

How can i get text option from AJAX generated select dropdown using jQuery?

From Dev

How to hide any item in select > option dropdown?

From Dev

Style text of select when the selected option is disabled

From Dev

AngularJs select add option

From Dev

How can I get value when click option in the select on vue?

From Dev

jQuery alert text in option from select tag

From Dev

Retrieve text (not value) from select option tag

From Dev

How can I exit from a jQuery event when an "unrelated" html select element has had no option selected?

From Dev

How to select an option from the dropdown when the dropdown has same ID

Related Related

  1. 1

    How to update any text filed when the user is select an option from a dropdown-menu?

  2. 2

    How I get the text instead value from a select option in CodeIgniter

  3. 3

    How can i remove HTML nbsp tags from select options when assigning the text of option to hidden input

  4. 4

    How do I update an Ember.Select when I add a new option?

  5. 5

    How do I update an Ember.Select when I add a new option?

  6. 6

    How to select any random menu/option from div tag?

  7. 7

    In Javascript how do I add a new option into Html Select so inserted based on alphabetical value of text

  8. 8

    display select option from database when select option change

  9. 9

    Add custom option (text + value) in a select tag

  10. 10

    Add custom option (text + value) in a select tag

  11. 11

    Any option for calculation from select value

  12. 12

    How to display only part of the option text in a select when it is not dropped down

  13. 13

    How can I add a disabled option when populating a select with Vue.js v-for

  14. 14

    How to select an option from dropdown select

  15. 15

    How can I hide an option of a select by it's text value?

  16. 16

    How can I add a <select> option using jquery?

  17. 17

    How can I add Options to a Select after a specific Option in jQuery?

  18. 18

    HTML - changing color in text area from an option inside of a select box generated from mysql

  19. 19

    jQuery typeahead stops working when I select an option from the dropdown

  20. 20

    How to add option fetched from the database to the end in select php

  21. 21

    How can i get text option from AJAX generated select dropdown using jQuery?

  22. 22

    How to hide any item in select > option dropdown?

  23. 23

    Style text of select when the selected option is disabled

  24. 24

    AngularJs select add option

  25. 25

    How can I get value when click option in the select on vue?

  26. 26

    jQuery alert text in option from select tag

  27. 27

    Retrieve text (not value) from select option tag

  28. 28

    How can I exit from a jQuery event when an "unrelated" html select element has had no option selected?

  29. 29

    How to select an option from the dropdown when the dropdown has same ID

HotTag

Archive