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 6 of 6

Thread: Disable Submit

  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Location
    Indian Harbour Beach, FL
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Disable Submit

    I'm looking to know if there's a way to disable the focus to the submit button on a form?

    I understand that I could create a link that would do the same thing as a submit button but it takes away from the basic look / feel of the page.

    Basically just trying to avoid accidental submission.

  • #2
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    People will still be able to submit by pressing enter (something I've accidentally done many times before). This will also render your submit button inoperable by those using a keyboard.

  • #3
    New to the CF scene
    Join Date
    Jan 2005
    Location
    Indian Harbour Beach, FL
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unclear

    That last post was a bit unclear. Were you saying that I should use a hyperlink instead of of a submit button? Or were you advocating another method by which the button can be disabled but still accessible via mouse click?

  • #4
    Senior Coder chilipie's Avatar
    Join Date
    Jul 2004
    Location
    Shrewsbury, UK Age: 16
    Posts
    1,117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by hemebond
    People will still be able to submit by pressing enter (something I've accidentally done many times before).
    Not neccessarily...

  • #5
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    That's a bit of a mess just to prevent a form submission. Plus he was asking about disabling a submit button only. Not the entire form.

    thecadguy, what you're proposing is breaking the default behaviour of the form. This is not a good thing to do, regardless of your good intentions. To be honest, I find it difficult to believe that your users accidentally click the submit button.

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Maybe you just need some kind of form validation - something that returns false on the form submission unless certain values are properly filled in ..?
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark


  •  

    Posting Permissions

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