Noticed that I couldn't post, edit, or preview a comment when I'm using the disable buttons option as the script mode.

Comments

optalgin’s picture

This is a good one :-)

This is really strange, the scripts for hide -or- disable are very close
I have no idea why hiding works for both nodes and comments
and disabling works for nodes but fails for comments ?!?

* I also noted the pointless image preload..

I'll try to analyze it.. any javascript advises are welcome

<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery("<img>").attr("src",'/sites/all/modules/hide_submit/images/loader.gif');
$(document).ready(function() {

    $('input:submit:not(.hide-submit-exclude)').click(function() {
      $(this).siblings('input:submit').attr('disabled', true); $(this).attr('disabled', true);
    })  
})
//--><!]]>
</script>
optalgin’s picture

Component: Miscellaneous » Code
Assigned: Unassigned » optalgin
Status: Active » Needs work

I think I found a solution..
I'll add it soon to the dev. release for testing

The problem is that disabled buttons are not included in the form POST variables
Drupal comment module uses the "op" variable to know which button was pressed (preview/save)
but it is not there because buttons are disabled.

so my current solution is to inject a hidden form element named "op" and assign the value of the clicked button to it.

// HTML
...
<input type="hidden" name="comment-fix" id="hide-submit-comment-fix" value=""  />
...

// jQuery script
   ...
   $("#hide-submit-comment-fix").attr("name", "op");
   $("#hide-submit-comment-fix").attr("value", $(this).attr("value"));
   ...

optalgin’s picture

Status: Needs review » Needs work

Workaround commited, please review
Please check the 6.x-1.x-dev release
New package should be ready soon (verify date - jan-2010)

optalgin’s picture

Status: Needs work » Needs review
Platinum’s picture

Status: Needs work » Needs review

So far it seems to work fine in Firefox, but in IE8, the disable button doesn't work on any submit. It disables the submit buttons but then the page just does nothing. Anyone else have this problem?

YK85’s picture

Status: Needs review » Fixed

i just installed and tested this module and it works in IE
please re-open if you still experience the problem

YK85’s picture

Status: Fixed » Active

setting back to 'active' as per other post by maintainer

optalgin’s picture

Status: Active » Postponed
greggles’s picture

Issue summary: View changes
Status: Postponed » Closed (outdated)

Thanks for submitting this issue.

The 6.x branch of this module is not supported. This issue was filed against the 6.x version so I'm closing it because it doesn't seem relevant to the 7.x version.

If the issue is relevant for the 7.x version: I apologize for closing it. Can you please reopen it and adjust the version number?