By optalgin on
I'm trying to improve a module I wrote which uses jqeury snippet
// Select all submit buttons and siblings
$(document).ready(function() {
$('input:submit').click(function() {
$(this).siblings('input:submit').hide();
$(this).hide();
$('$message').insertAfter(this);
})
})
I want to filter/exclude not to choose elements that are children of specific class/id
<div id='one'>
<input name="op" id="edit-1-1" value="Submit 1-1" class="form-submit" type="submit">
<input name="op" id="edit-1-2" value="Submit 1-2" class="form-submit" type="submit">
</div>
<div id='two'>
<input name="op" id="edit-2" value="Submit 2-1" class="form-submit" type="submit">
<input name="op" id="edit-2" value="Submit 2-2" class="form-submit" type="submit">
</div>
For example I want NOT to choose submit buttons that are children of #one
See original issue #432988: Conflicts with shoutbox module
Any ideas?
Comments
This is what you want:
This is what you want: http://docs.jquery.com/Selectors/not#selector
Contact me to contract me for D7 -> D10/11 migrations.
I still can't do it
Thanks
I tried to play with :not selector but I still don't get the result I want
Select all submit button since, non of them are #one, only the "father" div container
This works, and select a specific button, but this is not what I am looking for
I think the logic should be something like subtraction between sets
Is there a way to do it?
I don't see a reason why this should be complicated
The main reason I need this is to disable the feature for specific css containers
such as shout-box etc..
Ohhh.. this is a hard nut I
Ohhh.. this is a hard nut
I can select submit buttons of certain div
But I cannot find a way to select all submit buttons that are NOT in this div...
This selector is the best I could find, but it doesn't work ...
Anyone?
I just played with that for
I just played with that for about 15 minutes, but I couldn't figure it out. Maybe try http://jqueryhelp.com/ - they are soon to become the official jquery help forum.
If you find an answer, can you post it here? I'm curious.
Contact me to contract me for D7 -> D10/11 migrations.