So I’m trying to write an interactive form, where clicking a radio button will unhide another field in the form. It is for display purpose, so I’m not submitting anything. I’m attempting to use Javascript to validate, but needless to say, it’s not working very well. A run through of my code would be appreciated.
Since it’s so much code, I’ll pastie it to you for convenience…
http://pastie.org/3615669
Thanks 🙂
Your code:
You cannot use the variable
namelike that. It’s a string and it will not get “replaced” or whatever you were hoping would happen. You’ll need to usedocument.getElementsByName(name)to select that element. But that will give you a node list so you probably want to use ids instead there.