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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    form id is an object

    i've just come across the strangest problem and was hoping someone else has seen this.

    i'm using multiple forms in a document and pass 'this' on the onSubmit event to tell the validation routine which form has been submitted. this has always worked just fine for me but i've got one document where the id property of the form is not a string, like i'd expect, but an HTMLInputElement! what the heck?

    i've posted the complete page at http://www.meds4vets.biz/a.html. if you click any of the "update" buttons you'll see what i mean.

    if anyone has any clues i'd appreciate some direction.

    tia

  • #2
    Banned
    Join Date
    Nov 2008
    Location
    not found
    Posts
    284
    Thanks
    0
    Thanked 53 Times in 51 Posts
    Quote Originally Posted by rhumbliner View Post
    i've got one document where the id property of the form is not a string, like i'd expect, but an HTMLInputElement!
    Since your site won't load, best guess: you've probably named one of your fields 'id'.

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,633 Times in 4,595 Posts
    How hard will you kick yourself??
    Code:
    	<form id=f000005 action="/" method="post" onSubmit="return admin_p2(this)">
    	<input type=hidden name=page value=upd_product>
    	<input type=hidden name=id value="000005">
    Now try using
    Code:
    	<form id=f000005 action="/" method="post" onSubmit="return admin_p2(this)">
    	<input type=hidden name=page value=upd_product>
    	<input type=hidden name=ID value="000005">
    Or some other name than "id".

    Same thing happens when you name a form field as "action" or "submit". The form fields take precedence over the properties of the <form> object.

    ***********

    Edit: RandomUser beat me to it, but I dunno why he says the site won't load. It loaded fine for me in both FF3 and MSIE6. Oh, well. He guessed right, of course.

  • #4
    New to the CF scene
    Join Date
    May 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    kicking myself every so often is good for me -- keeps me humble.

    thanks guys, your experience saved me a lot of time.


  •  

    Posting Permissions

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