After disabling JavaScript in my browser, clicking on 'Add' to add a term or 'Update' to refresh the taxonomy list submits the form. This happens both on the node create form, as well as the 'preview' on the vocabulary edit form. It looks to me like these buttons are being defined correctly in hierarchical_select_process(), but they are submit types when rendered on the page.

hierarchical_select.module, line 598

$element['hierarchical_select']['dropbox_add'] = array(
  '#type'       => 'button',
  '#value'      => t('Add'),
  '#attributes' => array('class' => 'add-to-dropbox'),
);

hierarchical_select.module, line 636

$element['nojs']['update_button'] = array(
  '#type'       => 'button',
  '#value'      => t('Update'),
  '#attributes' => array('class' => 'update-button'),
);

Any ideas? This is a blocker for me, and I don't have time to debug further.

Comments

wim leers’s picture

Status: Active » Postponed (maintainer needs more info)

I have no idea how that could happen :S

Especially because exactly the same code flow is used when JS is enabled: those buttons are pressed then, too. It must be the submit handlers, but it's been working fine for so long …

Can you reproduce this on a vanilla Drupal site? If you cannot, keep on adding modules that you're using on your actual site until the problem is reproduced.

When you're able to reproduce this (on a vanilla Drupal site with the minimum number of modules to reproduce it), then please make a screencast of:

  1. your site configuration
  2. the problem being reproduced

That makes it easier for me to reproduce the problem. Thanks!

P.S.: don't have any screencast software yet? On Windows and Mac OS X, you can use the free Jing.

wim leers’s picture

I bet this is caused by http://drupal.org/node/621956#comment-2400440.

Can you do a fresh Drupal 6.13 install and then try to reproduce the problem? That would give a more definitive answer.

dinknaround’s picture

Version: 6.x-3.x-dev » 6.x-3.0

FYI...I ran into same issue today. Fresh D6 install, d6 core mods enabled. HS mod only one added on. When creating new node, and javascript disabled, clicking on "add" after selecting a term automatically saves the node.

dinknaround’s picture

A bit more FYI...the only two HS mods I have enabled are HS and HS Taxonomy. Again, javascript disabled, selecting "add" or "update" (depending on HS Dropbox Settings enabled or not), this issue also occurs on the edit vocabulary pages.

Wondering if HS's form item "$element['nojs']['update_button']" has a callback function or not to rebuild the form? I haven't found it yet. Could this be the reason? Also to humbly admit, I'm still learning Drupal forms api, so I could be wrong. Drupal's core Pole module has code for no js as a good example (I think).

wim leers’s picture

Could you please make a screencast of the problem being reproduced. That makes it easier for me to understand the problem. Thanks!

P.S.: don't have any screencast software yet? On Windows and Mac OS X, you can use the free Jing.

wim leers’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Closing due to lack of response. Feel free to reopen!

adrinux’s picture

Title: Add and Update buttons are submitting forms when JavaScript is disabled » Add and Update buttons are submitting forms
Status: Closed (fixed) » Active

Re-opening and slight change of title.

I have a site where the 'Add' button is submitting the node! That's with javascript enabled.
The same page has the admin_menu, imagefield image upload widget and tinymce along with HS, I suspect some sort of collision.

Versions:
admin_menu 6.x-3.x-dev
imagefield 6.x-3.2
Wysiwyg 6.x-2.1 with TinyMCE 3.3.2
jQuery update 6.x-2.x-dev with jQuery 1.3.2

Hierarchical Select & Hierarchical Select Taxonomy 6.x-3.0 enabled

Cache disabled, Optimize JavaScript files disabled.

Just trying to fill out the picture with this post. I'm off to play with enabling/disabling modules and performance options.

Tried looking for error messages in webkit's inspector with nothing apparently wrong. Any suggestions for resources on debugging javascript would be welcome.

wim leers’s picture

Status: Active » Postponed (maintainer needs more info)

Try disabling:
- Wysiwyg 6.x-2.1 with TinyMCE 3.3.2
- jQuery update 6.x-2.x-dev with jQuery 1.3.2

I bet it's either one of those.

adrinux’s picture

Priority: Critical » Normal
Status: Postponed (maintainer needs more info) » Closed (fixed)

Actually I can't replicate this. Though there are other problems, but those deserve another issue. Closing for now.

Soren Jones’s picture

Component: Code » Code - Content Taxonomy
Status: Closed (fixed) » Active

Here is some more information on reproducing the issue.

Drupal 6.19
CCK 6.x-2.8
Content Taxonomy 6.x-1.0-rc2
Hierarchical Select 6.x-3.6
*Dropbox enabled

With javascript disabled, clicking on Add submits the node.
With javascript enabled, after clicking "Add another item" for a CCK field with Number of values set to Unlimited, clicking on Add submits the node.

Soren Jones’s picture

Title: Add and Update buttons are submitting forms » Add submits forms after adding another item to a CCK field with JS disabled
Version: 6.x-3.0 » 6.x-3.6

Clarifying the title and changing the version. Happy to help however I can.

Soren Jones’s picture

Title: Add submits forms after adding another item to a CCK field with JS disabled » Add submits forms after adding another item to a CCK field OR with JS disabled

Oops. Forgot the or...

wim leers’s picture

Status: Active » Closed (won't fix)

See the updated project page:

Note: the Content Taxonomy module integration is no longer supported. Patches are accepted and committed, but the maintainer does no longer want to fix bugs with this integration. The reason is simple. It's a nightmare. It makes one suicidal. Content Taxonomy is rotten. It needs to die. Thank god it won't be necessary to port this functionality to Drupal 7