• Selector not though unless

    From Andrew Poulos@21:1/5 to All on Tue Dec 15 15:06:13 2020
    How do I select all inputs in a form but not of type button, unless the
    button has the class called, say, 'preview'?

    I started writing
    input:not([type="button"]), input.preview
    and then wondered if it was appropriate. The first part of the selector
    selects all non-button inputs while the second part should select
    buttons with a 'preview' class. Will the first part discount the second?

    Andrew Poulos

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Evertjan.@21:1/5 to Andrew Poulos on Tue Dec 15 17:17:14 2020
    Andrew Poulos <ap_prog@hotmail.com> wrote on 15 Dec 2020 in comp.infosystems.www.authoring.stylesheets:

    How do I select all inputs in a form but not of type button, unless the button has the class called, say, 'preview'?

    I started writing
    input:not([type="button"]), input.preview
    and then wondered if it was appropriate. The first part of the selector selects all non-button inputs while the second part should select
    buttons with a 'preview' class. Will the first part discount the second?

    What do you mean by "appropriate", if your mother-in-law will concur?
    Discounts only in your mother-in-law's delicatessen!

    The proof surely is in the eating.

    <style>
    input {background:yellow;}
    input:not([type="button"]), input.preview {background:navy;}
    </style>

    <input type='button'>
    <input type='button'>
    <input type='button'>
    <input type='button' class='preview'>
    <input class='preview'>



    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrew Poulos@21:1/5 to Evertjan. on Wed Dec 16 07:36:02 2020
    On 16/12/2020 3:17 am, Evertjan. wrote:
    Andrew Poulos <ap_prog@hotmail.com> wrote on 15 Dec 2020 in comp.infosystems.www.authoring.stylesheets:

    How do I select all inputs in a form but not of type button, unless the
    button has the class called, say, 'preview'?

    I started writing
    input:not([type="button"]), input.preview
    and then wondered if it was appropriate. The first part of the selector
    selects all non-button inputs while the second part should select
    buttons with a 'preview' class. Will the first part discount the second?

    What do you mean by "appropriate", if your mother-in-law will concur? Discounts only in your mother-in-law's delicatessen!

    By "appropriate" I meant that it does what I am expecting/hoping it will
    and have behave counter intuitively (have the expected action discounted).

    The proof surely is in the eating.

    <style>
    input {background:yellow;}
    input:not([type="button"]), input.preview {background:navy;}
    </style>

    <input type='button'>
    <input type='button'>
    <input type='button'>
    <input type='button' class='preview'>
    <input class='preview'>

    Thanks, I ran your example and the selector works.

    Andrew Poulos

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Evertjan.@21:1/5 to Andrew Poulos on Tue Dec 15 23:59:30 2020
    Andrew Poulos <ap_prog@hotmail.com> wrote on 15 Dec 2020 in comp.infosystems.www.authoring.stylesheets:


    On 16/12/2020 3:17 am, Evertjan. wrote:
    Andrew Poulos <ap_prog@hotmail.com> wrote on 15 Dec 2020 in
    comp.infosystems.www.authoring.stylesheets:

    How do I select all inputs in a form but not of type button, unless the
    button has the class called, say, 'preview'?

    I started writing
    input:not([type="button"]), input.preview
    and then wondered if it was appropriate. The first part of the selector
    selects all non-button inputs while the second part should select
    buttons with a 'preview' class. Will the first part discount the second?

    What do you mean by "appropriate", if your mother-in-law will concur?
    Discounts only in your mother-in-law's delicatessen!

    By "appropriate" I meant that it does what I am expecting/hoping it will
    and have behave counter intuitively (have the expected action discounted).

    Appropriate means, imho, 'working' + 'socially correct',
    I don't think intuition has much to do with it.

    The proof surely is in the eating.

    <style>
    input {background:yellow;}
    input:not([type="button"]), input.preview {background:navy;}
    </style>

    <input type='button'>
    <input type='button'>
    <input type='button'>
    <input type='button' class='preview'>
    <input class='preview'>

    Thanks, I ran your example and the selector works.

    Okay, you got the taste.


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrew Poulos@21:1/5 to Evertjan. on Wed Dec 16 11:13:13 2020
    On 16/12/2020 9:59 am, Evertjan. wrote:

    By "appropriate" I meant that it does what I am expecting/hoping it will
    and have behave counter intuitively (have the expected action discounted).

    Appropriate means, imho, 'working' + 'socially correct',
    I don't think intuition has much to do with it.

    Appropriate also means "Suitable for a particular person, condition,
    occasion, or place."

    Andrew Poulos

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Barry Margolin@21:1/5 to Andrew Poulos on Wed Dec 16 15:01:13 2020
    In article <27ednUz4JfKqq0XCnZ2dnUU7-I_NnZ2d@westnet.com.au>,
    Andrew Poulos <ap_prog@hotmail.com> wrote:

    How do I select all inputs in a form but not of type button, unless the button has the class called, say, 'preview'?

    I started writing
    input:not([type="button"]), input.preview
    and then wondered if it was appropriate. The first part of the selector selects all non-button inputs while the second part should select
    buttons with a 'preview' class. Will the first part discount the second?

    No, the two selectors are treated independently. So the result is the
    union of all elements that match either selector.

    Basically

    selector1, selector2 {
    styles;
    }

    is equivalent to

    selector1 {
    styles;
    }
    selector2 {
    styles;
    }

    --
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrew Poulos@21:1/5 to Barry Margolin on Fri Dec 18 08:02:13 2020
    On 17/12/2020 7:01 am, Barry Margolin wrote:
    In article <27ednUz4JfKqq0XCnZ2dnUU7-I_NnZ2d@westnet.com.au>,
    Andrew Poulos <ap_prog@hotmail.com> wrote:

    How do I select all inputs in a form but not of type button, unless the
    button has the class called, say, 'preview'?

    I started writing
    input:not([type="button"]), input.preview
    and then wondered if it was appropriate. The first part of the selector
    selects all non-button inputs while the second part should select
    buttons with a 'preview' class. Will the first part discount the second?

    No, the two selectors are treated independently. So the result is the
    union of all elements that match either selector.

    Basically

    selector1, selector2 {
    styles;
    }

    is equivalent to

    selector1 {
    styles;
    }
    selector2 {
    styles;
    }

    Ah, so the comma acts like an "or".

    Andrew Poulos

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kirk@21:1/5 to Andrew Poulos on Thu Dec 17 20:58:25 2020
    In Message: <a--dnRoCzMzKWkbCnZ2dnUU7-KednZ2d@westnet.com.au>
    Andrew Poulos <ap_prog@hotmail.com> wrote:

    On 17/12/2020 7:01 am, Barry Margolin wrote:

    In article <27ednUz4JfKqq0XCnZ2dnUU7-I_NnZ2d@westnet.com.au>,
    Andrew Poulos <ap_prog@hotmail.com> wrote:

    [snip]

    input:not([type="button"]), input.preview

    [snip]

    No, the two selectors are treated independently. So the result is
    the union of all elements that match either selector.

    [snip]

    Ah, so the comma acts like an "or".


    Groups of selectors <https://www.w3.org/TR/2018/REC-selectors-3-20181106/#grouping>

    Read the warning for invalid selectors.

    --
    Jš•’š•žš•–š•¤ š•‚š•šš•£š•œ

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)