Thanks, Niphlod, that is very helpful.. I think I'm on the right track now!


On Tue, Jul 1, 2014 at 12:02 PM, Niphlod <niph...@gmail.com> wrote:

> 1st rule: never, never, never use inline javascript.
> 2nd rule: start with console.log() and an open debugger (firebug, chrome
> developer tools, etc)
> 3rd rule: use the quotes! you are terribly wrong with those
> 3rd rule: simplify the code, then expand.
>
> $('#div2 button').on('click', function() {
>        console.log($("input[name^='something'"))
> })
>
>
> On Tuesday, July 1, 2014 6:14:41 PM UTC+2, Jordan Ladora wrote:
>>
>> Hi,
>>
>> I'm trying to make a button that will check some boxes in a form based on
>> the checkboxes' name attributes.
>>
>> But I can't get this to work-
>> <div id='div2'>
>>   <button onclick="event.preventDefault();jQuery('input[name^='
>> somecheckbox']').each(function(k){jQuery(this).prop('checked',
>> false);});">Deselect All</button>
>> </div>
>>
>> I'm basing it off http://api.jquery.com/attribute-starts-with-selector/
>>
>> I've tried a few different things but cannot get it to do anything good..
>>
>> Thanks for any pointers,
>> -jl
>>
>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/oZ_u_XPbEys/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to