Results 1 to 3 of 3

Thread: Showing hiding form elements

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2006
    Location
    From the UK
    Posts
    422

    Question 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

  2. #2
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015

    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';

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2006
    Location
    From the UK
    Posts
    422

    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width