Skip to content
Advertisement

Problems dynamically adding to form (trying to use onChange and appendTo)

I want my form to extend in different ways depending on the selection of a drop down box.

I have got my JavaScript working so that onchanging my selection it will carry out something. But I am trying to use the appendTo() method as I have used before; for adding a single input, to work for implementing a div and a few inputs. Its not working, hence the post 😉

So I was hoping you could enlighten me as to a better method?

Here is my current code (courtesy of Mark):

JavaScript

note: updated since answers.

here is constructed in jsfiddle

It does nothing currently.

Please help? 😀

Advertisement

Answer

I think value you are trying to case on is a string not a number

try this

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement