Hi Rik! :)
Example 1:
Global filter may have 2-3 fields in block and when user choose one field it is highlighted by css as filled and user see that next field to make choice in!
Main Idea: when user make choice in select field and may be fills text-fields, they are highlighted and may have in css style mini-image Status FILLED
Action: Css style is added to field-wrapper when user makes choice!
Usability: guide user through the form by filled and unfilled fields
The same styles may be done for text-fields, textarea, ... any kind!
Value For Drupal forms:
In forms we may have different big quantity of fields and
to help user fill them such will guide user through the form by filled and unfilled fields in form, step by step, field by field!
CSS can be amazing: there can be background-images like filled, colored options, they may disappear when filled ... so much opportunities!
PS: Imagine, how it would be great! Interactive form!
Comments
Comment #1
RdeBoerHi carliton,
Sorry, but I don't understand what it is you want Select with Style to do.
Could you please make a mockup picture or describe it more accurately?
Comment #2
Jarviss CreditAttribution: Jarviss commentedWhat should happen:
When user chose option in select, Select with Style module adds css class to option that it is selected!
Without page refresh!
Using power of CSS we can style selected options and filled text-fields as we want.
In addition: for Text-fields, for texareas ... When user fill the field Select with Style module adds css class that field is filled!
Comment #3
RdeBoerOk, I get you now.
This will require javascript/jQuery, but not a lot.
I'm not sure it will work as the browser already does its own highlighting when you click an option in a select box. What you are saying is that you want to override that behaviour, using different colours and font styles ?
Comment #4
Jarviss CreditAttribution: Jarviss commentedBrowser usually highlight onmousover event, I am talking about SELECTED.
When I choose select option in Field_1, and select option in Field_2: Field_1 is highlighted that the choice in field_1 was made.
And next after I select option in Field_2 it will highlight that choice is also made.
Like checklist, or behavior in drupal modules section, when you install and uninstall module,
step by step, field after field, some kind of controlling weather all or not all fields are selected and filled by user.
Comment #5
RdeBoerBut the browser already does that. When you click an option in a multi-choice select box, for instance, the background of the option goes blue (in most browsers).
Then when you move to the next multi-choice select box on the same page and click an option there, then that one goes blue, while the option in the first select box goes back to grey (or whatever the "selected" color is set to by your browser).
Is what you want to change the "selected" font and color attributes:
This works in Firefox only for the font-style and font-weight and not at all in Chrome or Safari.
Comment #6
Jarviss CreditAttribution: Jarviss commentedExample code:
Comment #7
Jarviss CreditAttribution: Jarviss commentedAdditional Example code: Works in Last versions of Chrome Opera Safari Firefox
Comment #8
Jarviss CreditAttribution: Jarviss commentedCan be interesting in addition:
Select Dropdown Onmouseover
Works in Last versions of Chrome Opera Safari Firefox
Comment #9
RdeBoerHi Carliton,
On what browser(s) did you try this?
Rik
Comment #10
Jarviss CreditAttribution: Jarviss commentedWorks in Last versions of Chrome Opera Safari Firefox
Comment #11
RdeBoerI tried these and they look good.
I'm not sure what to do about incorporating these into Select with Style module.
There's actually no PHP code required.
We could pretty much just add a stylesheet.
Suggestions?
Comment #12
Jarviss CreditAttribution: Jarviss commentedPHP may be necessary to insert class (for css-wrapper and for option) that option or textfield that is selected or not empty,
And then css will do the styling automatically!
Comment #13
RdeBoerSo what exactly should go in SwS and how is the user going to specify it, ie UI?
Comment #14
Jarviss CreditAttribution: Jarviss commentedValuable code is in #7 comment, In UI admin may for example change class-names but it not so necessary, css may be styled by default and rewritten by designer!
Comment #15
RdeBoerSo I simplified your examples a bit and put them into one:
There is still little need for Select with Style to do anything.
The second one, for example you can achieve simply by importing the following piece of code, or even inserting it in the content of the page that has the selects that you want to add a green border to when clicked:
Comment #16
Jarviss CreditAttribution: Jarviss commentedI don't understand!
when I put on my page.tpl.html it doesn't work, no color no bgcolor change?
Comment #17
Jarviss CreditAttribution: Jarviss commentedSelect with style could give opportunity to post #color and option to open list on hover using UI! For quick solution!
Comment #18
RdeBoerHi Carliton,
Re #16:
When doing this in Drupal forget about the code of part 1 in #15.
Copy exactly the script code from the 2nd part of #15 and paste that in the body of the Edit form (including the <script> tags) of a page that has some select (drop-down) on.
It will just do the green border color -- I kept it simple.
Rik
Comment #19
RdeBoerRe #17:
I don't think I understand you...
Comment #20
Jarviss CreditAttribution: Jarviss commentedRe: #18 paste code in the body of the Edit form How to do that simply?
Re: #17 it is optional for simple use when admin can past his color to Select with Style form and it will be simply applied to fields!
Comment #21
RdeBoerI think what I'll do is put the javascript required for the examples in #15 in a little select_with_style.js file that Select with Style will automatically include with every page load.
The javascript code in that file will initially be commented out and administrators can then uncomment the features they like. These features will work for all targeted HTML elements, not just for the <select>'s that belong to Select with Style.
Good idea?
Comment #22
RdeBoerDone #21 and released as 7.x-1.0-beta4.
Suggestions for more effects welcome.
Comment #23
RdeBoerComment #24
Jarviss CreditAttribution: Jarviss commentedNeed Css class .required for Select with style widget if field is required! In each kind of field, select, text, texarea!
Comment #25
RdeBoerAlready done. Part of core.
Comment #26
Jarviss CreditAttribution: Jarviss commentedRik, do you mean core of Select with style? because I don't see .required class when I use Select with style widget?
Usually we have class="form-select required" when I use Select with style I get class="with-style" and no required
Comment #27
RdeBoerSelect with Style 7.x-1.0, just released :-)
Comment #28
Jarviss CreditAttribution: Jarviss commentedReally Thank you Rik for your activity and energy, it is valuable!
Comment #29
RdeBoerMuch appreciated.
Comment #29.0
RdeBoer...