Create event based on select in a selectlist
Create event based on select in a selectlist
Hi, I am trying to figure out a problem I have here.
When a user select something in a selectlist I want textfields to pop up beneath it. This is what I have for now:
<
select
id
="
edit-submitted-hur-manga-personer
"
class
="
form-select
"
name
="
submitted[hur_manga_personer]
"
>
<
option
value
="
"
>Choose
...
</
option
>
<
option
value
="
1
"
>
1 Person
</
option
>
<
option
value
="
2
"
>
2 Persons
</
option
>
<
option
value
="
3
"
>
3 Persons
</
option
>
<
option
value
="
4
"
>
4 Persons
</
option
>
</
select
>
$(document).ready(function(){
if ($("#edit-submitted-hur-manga-personer :selected").val() == 1) {
$("#webform-component-person_1").css("display", "block");
}
else $("#webform-component-person_1").css("display", "none");
});
I don't know if it is the value that's wrong, I don't know if you can do it like that.
The "#webform-component-person_1" is a fieldset containing some textfields.
Topic Participants
christian-15
suhajdab