Posted by Platinum on November 14, 2009 at 6:18am
Jump to:
| Project: | Hide submit button |
| Version: | 6.x-1.9 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Optalgin |
| Status: | postponed |
Issue Summary
Noticed that I couldn't post, edit, or preview a comment when I'm using the disable buttons option as the script mode.
Comments
#1
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>
#2
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"));
...
#3
Workaround commited, please review
Please check the 6.x-1.x-dev release
New package should be ready soon (verify date - jan-2010)
#4
#5
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?
#6
i just installed and tested this module and it works in IE
please re-open if you still experience the problem
#7
setting back to 'active' as per other post by maintainer
#8