01-24-2005, 10:12 PM
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.
01-25-2005, 01:04 AM
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.
01-25-2005, 05:50 PM
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?
01-25-2005, 07:01 PM
People will still be able to submit by pressing enter (something I've accidentally done many times before).
Not neccessarily... (http://www.codingforums.com/showthread.php?p=263207#post263207)
01-26-2005, 09:43 PM
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.
01-26-2005, 10:18 PM
Maybe you just need some kind of form validation - something that returns false on the form submission unless certain values are properly filled in ..?