Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy checking if a form element exists on a form

    I have a web page that has a html form on it with several hidden <input> tags present on the html form. However depending on how i get to that web page some of the hidden form <input> elelments may not be present.

    Now I already have some javascript funtions to manipulate these form elements, but I need to modify them to check if a particular hidden form element exists or not to control which javascript code to execute.

    Please help! Cheers.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    if (typeof document.form_name.element_name != 'undefined') {......
    } else {.....

  • #3
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Cheers for the input. I tried the code you gave and it worked a treat.


  •  

    Posting Permissions

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