Create a button "delete selectected"
And bind this jQuery (need to adapt to your need, for example if you just
want to remove you need to remove everything ".end()..." except the ";") :
$('#mySelect')
.find('option')
.remove()
.end()
.append('<option value="whatever">text</option>')
.val('whatever')
;
Ref :
http://stackoverflow.com/questions/47824/how-do-you-remove-all-the-options-of-a-select-box-and-then-add-one-option-and-se
Is that what you need?
Richard
On Thu, Aug 22, 2013 at 7:17 AM, Annet <[email protected]> wrote:
> @Massimo,
>
> Thanks for your reply.
>
>
> What is "multiple=(1,5)". It should be True or False.
>>
>
> I read this in a post in the group:
>
> Try
>
> IS_IN_DB(..., multiple=(0, 3))
>
> The "multiple" argument to IS_IN_SET and IS_IN_DB can be a list or tuple
> specifying a minimum and maximum number of items to be selected (strictly
> less than on the max, so set the max to 3 to make sure there are no more
> than 2).
>
> In my case the user should select 1 to 4 functions, hence multiple=(1,5).
>
> @Richard
> I know I can redefine the requires at any level, however, this is not
> about setting a requires, its is about deselecting all options in case the
> user no longer wants any of the options, at the moment I can only deselect
> all but one.
>
> Adding:
> form.element('select[name=pluginID]').insert(0,"Deselect all plugins")
>
> Makes this an option, which is a bit awkward.
>
>
> Kind regards,
>
> Annet
>
> --
>
> ---
> 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 [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.