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 Coder
    Join Date
    Dec 2006
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts

    input tag without form? (error in IE)

    Hi,

    I have been using DOM to create two input tags, a text field and a button. I have been appending the input tags to a form. However, I actually have no need for a form because the button calls a javascript, and there is no submit action.

    In fact, it is detrimental to be using a form because if a user hits enter in the textbox instead of using my button, it will try to submit the form, which is not what I want.

    So, I instead changed my form to a div and tried appending input tags directly to the div. It works perfectly in firefox, but has an error in IE6 (haven't tried IE7). "Object doesn't support this property or method." Why can't I append an input to a div? How can I accomplish my goal without using a form?

    For reference,
    http://weblamp-dev.princeton.edu/opplab/gameshell/

    Thanks!!
    Jeff

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    why not simply add an onsubmit="return false" on the form?
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #3
    New Coder
    Join Date
    Dec 2006
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts
    good call, thank you!

    jeff


  •  

    Posting Permissions

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