Drupal forms require a submit button

I'm working on an AJAX heavy site for a defined audience who all have JavaScript - so I have a form with no submit button that gets submitted by an change handler.

Normally I'd make sure the site was fully accessible - but not on this project so I just got rid of the submit button. I got the JavaScript submit working only to find my Drupal form no longer worked.

It seems that the Drupal submit handlers are not called if the form doesn't have a submit button. I can't see any reference to this in the Drupal API, but adding the  button back in and hiding it via CSS works fine.

 

Tags

Comments

http://www.starbowconsulting.

Comments

This is an old thread but I

This is an old thread but I ran into same thing with Drupal 6. After some looking through forms.inc and reviewing the form state array with eclipse I discovered if you set $form_state['submitted'] = true it will go to your submit function properly.

Gene Bernier
Web Developer
Acro Media Inc
http://www.acromediainc.com

Post new comment

Got something to add - just enter a comment
all other fields are optional.

Your email address will not be published.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image without spaces, also respect upper and lower case.