i have a html code as following
tfa_78 is a dropdown list, but build in formassembly, so not able to put it in the code the value "Test" is just to show myself, that the code in general is running ;)
<script>
var tfa78 = document.getElementById("tfa_78").selvalue;
if( tfa78 == "karte" )
{
document.getElementById('tfa_2448').innerHTML ='<b>Bei karte anrufen.</b> <br>';
} else {
document.getElementById('tfa_2448').innerHTML ='Test';
}
my question: it is not working, i do not get the first result, what might be wrong? is the selvalue the right thing to select the dropdown value? before, i used this code with a textfield, that was working, so i guess it is anyhow related to the wrong "get" value argument?
Thanks a lot in advance for your support.
I updated my code already due to few comments as below:
<script>
var tfa78 = document.getElementById("tfa_78").value;
if( tfa78 == 'tfa_2438' ) {
document.getElementById('tfa_2448').innerHTML ='<b> anrufen.</b> <br>';
}else {
document.getElementById('tfa_2448').innerHTML ='Test'+ tfa78;
}</script>
and this is the dropdown code, but i can not change that.
<select id="tfa_78" name="tfa_78" title="Quelle?" class="required"><option
value="">Bitte auswählen:</option>
<option value="tfa_2438" id="tfa_2438" data-conditionals="#tfa_93"
class="">karte</option>
<option value="tfa_2437" id="tfa_2437" data-conditionals="#tfa_93"
class="">Test</option>
</select>