<label> Porque te gusta nuestro negocio?
[select gustar
"Es una buena alternativa para emprender"
"Quiero ampliar mi negocio actual"
"Me gustan las facilidades que ofrecen"
"Otros"] </label>
Good to root this field in a form that I have with contact form 7, is there any way for the user to press "others" create a textarea for the user to write?
Now I have this in the code
<label> Porque te gusta nuestro negocio?
[select gustar id:result "Es una buena alternativa para emprender" "Quiero ampliar mi negocio actual" "Me gustan las facilidades que ofrecen" "Otros"] </label>
<script type="text/javascript">
function textarea(element){
document.getElementById("oculta").style.display = element=="otros"?"block";}
</script>
<label style="display: none;"> [text text-889 id:oculta] </label>
update:
<script type="text/javascript">
function gettextarea(){
var select = document.getElementById("result");
var selectedValue = select.options[select.selectedIndex].text;
if(selectedValue=="Otros"){
document.getElementById("textarea").style.display="block";
}else{
document.getElementById("textarea").style.display="none";
}}
</script>
<label onchange="gettextarea()"> Porque te gusta nuestro negocio?
[select gustar id:result "Es una buena alternativa para emprender" "Quiero ampliar mi negocio actual" "Me gustan las facilidades que ofrecen" "Otros"] </label>
<label id="textarea" style="display: none;"> [text text-889] </label>