Showing hiding form elements
I'm currently developing a PHP/MySQL site and I've come to a small problem...
What I have is a post and there is a little option box next to it with 'flag' inside it as well as a few other options. All I want to do is if the user chooses 'flag' a textarea appears, if not - it disappears...
At the moment what I'm doing is when they choose 'flag' it takes them to another page with the textarea on it, but of course the above method would save all that hassle...
As far as I understand (I'm a relative newbie to all this) JS can do this? But I've been looking on the net and it's not clear whether there are browser problems doing this or not..
Does anyone have a good way of handling this or should I not bother?
Thx :thumb:
Re: Showing hiding form elements
Yes, but there are various methods of referencing the element in question. Which you use depends on how you need it to function. How many of these are there? You can use document.getElementById('elID').style.display='none'; or = 'block'; or ='inline';
Re: Showing hiding form elements
I decided against using this method as I thought it would be better to make the user go to another page where I could explain the purpose of the form... Thanks for the advice though!